Skip to content

Commit 5827f69

Browse files
committed
Lint
1 parent cf8dbf8 commit 5827f69

File tree

6 files changed

+56
-39
lines changed

6 files changed

+56
-39
lines changed

README.md

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,24 @@
33
# LavaSrc
44

55
> [!IMPORTANT]
6-
> For LavaSrc v3 (Lavaplayer v1 & Lavalink v3) look [here](https://github.com/topi314/LavaSrc/tree/v3-legacy)
7-
8-
A collection of additional [Lavaplayer v2](https://github.com/sedmelluq/lavaplayer), [LavaSearch](https://github.com/topi314/LavaSearch) & [LavaLyrics](https://github.com/topi314/LavaLyrics) Audio Source Managers and [Lavalink v4](https://github.com/lavalink-devs/Lavalink) Plugin.
9-
* [Spotify](https://www.spotify.com) playlists/albums/songs/artists(top tracks)/search results/[LavaSearch](https://github.com/topi314/LavaSearch)/[LavaLyrics](https://github.com/topi314/LavaLyrics)
10-
* [Apple Music](https://www.apple.com/apple-music/) playlists/albums/songs/artists/search results/[LavaSearch](https://github.com/topi314/LavaSearch) (Big thx to [ryan5453](https://github.com/ryan5453) for helping me)
11-
* [Deezer](https://www.deezer.com) playlists/albums/songs/artists/search results/[LavaSearch](https://github.com/topi314/LavaSearch)/[LavaLyrics](https://github.com/topi314/LavaLyrics) (Big thx to [ryan5453](https://github.com/ryan5453) and [melike2d](https://github.com/melike2d) for helping me)
12-
* [Yandex Music](https://music.yandex.ru) playlists/albums/songs/artists/podcasts/search results/[LavaLyrics](https://github.com/topi314/LavaLyrics)/[LavaSearch](https://github.com/topi314/LavaSearch) (Thx to [AgutinVBoy](https://github.com/agutinvboy) for implementing it)
6+
> For LavaSrc v3 (Lavaplayer v1 & Lavalink v3) look [here](https://github.com/topi314/LavaSrc/tree/v3-legacy)
7+
8+
A collection of additional [Lavaplayer v2](https://github.com/sedmelluq/lavaplayer), [LavaSearch](https://github.com/topi314/LavaSearch) & [LavaLyrics](https://github.com/topi314/LavaLyrics)
9+
Audio Source Managers and [Lavalink v4](https://github.com/lavalink-devs/Lavalink) Plugin.
10+
11+
* [Spotify](https://www.spotify.com) playlists/albums/songs/artists(top tracks)/search
12+
results/[LavaSearch](https://github.com/topi314/LavaSearch)/[LavaLyrics](https://github.com/topi314/LavaLyrics)
13+
* [Apple Music](https://www.apple.com/apple-music/) playlists/albums/songs/artists/search results/[LavaSearch](https://github.com/topi314/LavaSearch) (Big thx
14+
to [ryan5453](https://github.com/ryan5453) for helping me)
15+
* [Deezer](https://www.deezer.com) playlists/albums/songs/artists/search results/[LavaSearch](https://github.com/topi314/LavaSearch)/[LavaLyrics](https://github.com/topi314/LavaLyrics) (Big
16+
thx to [ryan5453](https://github.com/ryan5453) and [melike2d](https://github.com/melike2d) for helping me)
17+
* [Yandex Music](https://music.yandex.ru) playlists/albums/songs/artists/podcasts/search
18+
results/[LavaLyrics](https://github.com/topi314/LavaLyrics)/[LavaSearch](https://github.com/topi314/LavaSearch) (Thx to [AgutinVBoy](https://github.com/agutinvboy) for implementing it)
1319
* [Flowery TTS](https://flowery.pw/docs) (Thx to [bachtran02](https://github.com/bachtran02) for implementing it)
14-
* [YouTube](https://youtube.com) & [YouTubeMusic](https://music.youtube.com/) [LavaSearch](https://github.com/topi314/LavaSearch)/[LavaLyrics](https://github.com/topi314/LavaLyrics) (Thx to [DRSchlaubi](https://github.com/DRSchlaubi) for helping me)
15-
* [Vk Music](https://music.vk.com/) playlists/albums/songs/artists(top tracks)/search results/[LavaLyrics](https://github.com/topi314/LavaLyrics)/[LavaSearch](https://github.com/topi314/LavaSearch) (Thx to [Krispeckt](https://github.com/Krispeckt) for implementing it)
20+
* [YouTube](https://youtube.com) & [YouTubeMusic](https://music.youtube.com/) [LavaSearch](https://github.com/topi314/LavaSearch)/[LavaLyrics](https://github.com/topi314/LavaLyrics) (Thx
21+
to [DRSchlaubi](https://github.com/DRSchlaubi) for helping me)
22+
* [Vk Music](https://music.vk.com/) playlists/albums/songs/artists(top tracks)/search
23+
results/[LavaLyrics](https://github.com/topi314/LavaLyrics)/[LavaSearch](https://github.com/topi314/LavaSearch) (Thx to [Krispeckt](https://github.com/Krispeckt) for implementing it)
1624
* [Tidal](https://tidal.com) playlists/albums/songs/search results (Thx to [Nansess](https://github.com/Nansess) and [InfNibor](https://github.com/infnibor) for implementing it)
1725

1826
> [!IMPORTANT]
@@ -21,8 +29,8 @@ A collection of additional [Lavaplayer v2](https://github.com/sedmelluq/lavaplay
2129
## Summary
2230

2331
* [Lavalink Usage](#lavalink-usage)
24-
* [Configuration](#configuration)
25-
* [Update Settings at Runtime](#update-settings-at-runtime)
32+
* [Configuration](#configuration)
33+
* [Update Settings at Runtime](#update-settings-at-runtime)
2634
* [Lavaplayer Usage](#lavaplayer-usage)
2735
* [Supported URLs and Queries](#supported-urls-and-queries)
2836

@@ -294,9 +302,9 @@ PATCH /v4/lavasrc/config
294302

295303
##### Tidal Config Object
296304

297-
| Field | Type | Description |
298-
|------------|--------|-------------------------|
299-
| ?token | string | The Tidal token |
305+
| Field | Type | Description |
306+
|--------|--------|-----------------|
307+
| ?token | string | The Tidal token |
300308

301309
<details>
302310
<summary>Example Payload</summary>
@@ -338,7 +346,6 @@ PATCH /v4/lavasrc/config
338346

339347
---
340348

341-
342349
## Lavaplayer Usage
343350

344351
Replace `x.y.z` with the latest version number
@@ -486,6 +493,7 @@ var searchManager = new SearchManager();
486493
// register source
487494
searchManager.registerSearchManager(appleMusic);
488495
```
496+
489497
</details>
490498

491499
---
@@ -556,7 +564,8 @@ searchManager.registerSearchManager(deezer);
556564
2. Go to https://oauth.yandex.ru/authorize?response_type=token&client_id=23cabbbdc6cd418abb4b39c32c41195d
557565
3. Authorize and grant access
558566
4. The browser will redirect to the address like `https://music.yandex.ru/#access_token=AQAAAAAYc***&token_type=bearer&expires_in=31535645`.
559-
Very quickly there will be a redirect to another page, so you need to have time to copy the link. ![image](https://user-images.githubusercontent.com/68972811/196124196-a817b828-3387-4f70-a2b2-cdfdc71ce1f2.png)
567+
Very quickly there will be a redirect to another page, so you need to have time to copy the
568+
link. ![image](https://user-images.githubusercontent.com/68972811/196124196-a817b828-3387-4f70-a2b2-cdfdc71ce1f2.png)
560569
5. Your accessToken, what is after `access_token`.
561570

562571
Token expires in 1 year. You can get a new one by repeating the steps above.
@@ -645,7 +654,8 @@ playerManager.registerSourceManager(new FloweryTTSSourceManager("..."));
645654

646655
#### Carefully, this token can be used to access your personal data. Use a newly created account specifically for LavaSrc. This source is designed mainly for the RU region, 80% of songs in other regions will not be played.
647656

648-
1. Go to the authorization page [Marusya application](https://oauth.vk.com/authorize?client_id=6463690&scope=1073737727&redirect_uri=https://oauth.vk.com/blank.html&display=page&response_type=token&revoke=1)
657+
1. Go to the authorization
658+
page [Marusya application](https://oauth.vk.com/authorize?client_id=6463690&scope=1073737727&redirect_uri=https://oauth.vk.com/blank.html&display=page&response_type=token&revoke=1)
649659
2. Authorize through your vk account.
650660
3. A link like this `https://oauth.vk.com/blank.html#access_token=$$$$$&expires_in=0&user_id=$$$$$@[email protected]`
651661
4. Copy your token and paste it into your config! Enjoy captcha-free vk music!
@@ -700,6 +710,7 @@ AudioPlayerManager playerManager = new DefaultAudioPlayerManager();
700710
var tidal = new TidalSourceManager("your tidal token");
701711
playerManager.registerSourceManager(tidal);
702712
```
713+
703714
#### LavaSearch
704715

705716
> [!NOTE]
@@ -716,7 +727,8 @@ playerManager.registerSourceManager(tidal);
716727
(check out [Spotify Recommendations Docs](https://developer.spotify.com/documentation/web-api/reference/get-recommendations) for the full query parameter list)
717728
* https://open.spotify.com/track/0eG08cBeKk0mzykKjw4hcQ
718729
* https://open.spotify.com/album/7qemUq4n71awwVPOaX7jw4
719-
* https://open.spotify.com/playlist/7HAO9R9v203gkaPAgknOMp (playlists can include local files if you enabled this via: `plugins.lavasrc.spotify.localFiles: true`. Please note `uri` & `isrc` will be `null` & `identifier` will be `"local"`)
730+
* https://open.spotify.com/playlist/7HAO9R9v203gkaPAgknOMp (playlists can include local files if you enabled this via: `plugins.lavasrc.spotify.localFiles: true`. Please note `uri` & `isrc`
731+
will be `null` & `identifier` will be `"local"`)
720732
* https://open.spotify.com/artist/3ZztVuWxHzNpl0THurTFCv
721733

722734
(including new regional links like https://open.spotify.com/intl-de/track/0eG08cBeKk0mzykKjw4hcQ)

main/src/main/java/com/github/topi314/lavasrc/tidal/TidalAudioTrack.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
package com.github.topi314.lavasrc.tidal;
22

33
import com.github.topi314.lavasrc.mirror.MirroringAudioTrack;
4-
import com.sedmelluq.discord.lavaplayer.container.mp3.Mp3AudioTrack;
54
import com.sedmelluq.discord.lavaplayer.tools.io.SeekableInputStream;
65
import com.sedmelluq.discord.lavaplayer.track.AudioTrack;
76
import com.sedmelluq.discord.lavaplayer.track.AudioTrackInfo;

main/src/main/java/com/github/topi314/lavasrc/tidal/TidalSourceManager.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package com.github.topi314.lavasrc.tidal;
22

3-
import com.github.topi314.lavasearch.result.AudioSearchResult;
43
import com.github.topi314.lavasrc.ExtendedAudioPlaylist;
54
import com.github.topi314.lavasrc.LavaSrcTools;
65
import com.github.topi314.lavasrc.mirror.DefaultMirroringAudioTrackResolver;
@@ -13,12 +12,9 @@
1312
import com.sedmelluq.discord.lavaplayer.tools.io.HttpInterface;
1413
import com.sedmelluq.discord.lavaplayer.tools.io.HttpInterfaceManager;
1514
import com.sedmelluq.discord.lavaplayer.track.*;
16-
1715
import org.apache.http.client.config.RequestConfig;
1816
import org.apache.http.client.methods.HttpGet;
1917
import org.apache.http.impl.client.HttpClientBuilder;
20-
import org.jetbrains.annotations.NotNull;
21-
import org.jetbrains.annotations.Nullable;
2218
import org.slf4j.Logger;
2319
import org.slf4j.LoggerFactory;
2420

@@ -30,7 +26,6 @@
3026
import java.nio.charset.StandardCharsets;
3127
import java.util.ArrayList;
3228
import java.util.List;
33-
import java.util.Set;
3429
import java.util.function.Consumer;
3530
import java.util.function.Function;
3631
import java.util.regex.Pattern;
@@ -46,12 +41,11 @@ public class TidalSourceManager extends MirroringAudioSourceManager implements H
4641
public static final int PLAYLIST_MAX_PAGE_ITEMS = 750;
4742
public static final int ALBUM_MAX_PAGE_ITEMS = 120;
4843
private static final String USER_AGENT = "TIDAL/3704 CFNetwork/1220.1 Darwin/20.3.0";
49-
private final String tidalToken;
5044
private static final Logger log = LoggerFactory.getLogger(TidalSourceManager.class);
51-
45+
private final String tidalToken;
5246
private final HttpInterfaceManager httpInterfaceManager = HttpClientTools.createDefaultThreadLocalManager();
53-
private int searchLimit = 6;
5447
private final String countryCode;
48+
private int searchLimit = 6;
5549

5650
public TidalSourceManager(String[] providers, String countryCode, Function<Void, AudioPlayerManager> audioPlayerManager, String tidalToken) {
5751
this(countryCode, audioPlayerManager, new DefaultMirroringAudioTrackResolver(providers), tidalToken);

plugin/src/main/java/com/github/topi314/lavasrc/plugin/LavaSrcPlugin.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
import com.github.topi314.lavasrc.deezer.DeezerAudioSourceManager;
99
import com.github.topi314.lavasrc.deezer.DeezerAudioTrack;
1010
import com.github.topi314.lavasrc.flowerytts.FloweryTTSSourceManager;
11-
import com.github.topi314.lavasrc.mirror.MirroringAudioTrackResolver;
12-
import com.github.topi314.lavasrc.mirror.DefaultMirroringAudioTrackResolver;
1311
import com.github.topi314.lavasrc.plugin.config.*;
1412
import com.github.topi314.lavasrc.protocol.Config;
1513
import com.github.topi314.lavasrc.spotify.SpotifySourceManager;
@@ -27,8 +25,6 @@
2725
import org.springframework.web.bind.annotation.RequestBody;
2826
import org.springframework.web.bind.annotation.RestController;
2927

30-
import java.util.Arrays;
31-
3228
@Service
3329
@RestController
3430
public class LavaSrcPlugin implements AudioPlayerManagerConfiguration, SearchManagerConfiguration, LyricsManagerConfiguration {

plugin/src/main/java/com/github/topi314/lavasrc/plugin/config/SourcesConfig.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,11 @@ public void setVkMusic(boolean vkMusic) {
7373
this.vkMusic = vkMusic;
7474
}
7575

76-
public boolean isTidal() { return this.tidal; }
76+
public boolean isTidal() {
77+
return this.tidal;
78+
}
7779

78-
public void setTidal(boolean tidal) { this.tidal = tidal; }
80+
public void setTidal(boolean tidal) {
81+
this.tidal = tidal;
82+
}
7983
}

plugin/src/main/java/com/github/topi314/lavasrc/plugin/config/TidalConfig.java

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,27 @@ public class TidalConfig {
1010
private int searchLimit;
1111
private String token;
1212

13-
public String getCountryCode() { return this.countryCode; }
13+
public String getCountryCode() {
14+
return this.countryCode;
15+
}
1416

15-
public void setCountryCode(String countryCode) { this.countryCode = countryCode; }
17+
public void setCountryCode(String countryCode) {
18+
this.countryCode = countryCode;
19+
}
1620

17-
public int getSearchLimit() { return this.searchLimit;}
21+
public int getSearchLimit() {
22+
return this.searchLimit;
23+
}
1824

19-
public void setSearchLimit(int searchLimit) { this.searchLimit = searchLimit;}
25+
public void setSearchLimit(int searchLimit) {
26+
this.searchLimit = searchLimit;
27+
}
2028

21-
public String getToken() { return token; }
29+
public String getToken() {
30+
return token;
31+
}
2232

23-
public void setToken(String token) { this.token = token;}
33+
public void setToken(String token) {
34+
this.token = token;
35+
}
2436
}

0 commit comments

Comments
 (0)