File tree Expand file tree Collapse file tree 3 files changed +22
-2
lines changed
src/main/java/lavalink/server/config Expand file tree Collapse file tree 3 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,8 @@ lavalink:
1818 local: false
1919 bufferDurationMs: 400
2020 youtubePlaylistLoadLimit: 6 # Number of pages at 100 each
21+ youtubeSearchEnabled: true
22+ soundcloudSearchEnabled: true
2123 gc-warnings: true
2224
2325metrics:
Original file line number Diff line number Diff line change @@ -31,14 +31,14 @@ public Supplier<AudioPlayerManager> audioPlayerManagerSupplier(AudioSourcesConfi
3131 }
3232
3333 if (sources .isYoutube ()) {
34- YoutubeAudioSourceManager youtube = new YoutubeAudioSourceManager ();
34+ YoutubeAudioSourceManager youtube = new YoutubeAudioSourceManager (serverConfig . isYoutubeSearchEnabled () );
3535 Integer playlistLoadLimit = serverConfig .getYoutubePlaylistLoadLimit ();
3636
3737 if (playlistLoadLimit != null ) youtube .setPlaylistPageCount (playlistLoadLimit );
3838 audioPlayerManager .registerSourceManager (youtube );
3939 }
4040 if (sources .isBandcamp ()) audioPlayerManager .registerSourceManager (new BandcampAudioSourceManager ());
41- if (sources .isSoundcloud ()) audioPlayerManager .registerSourceManager (new SoundCloudAudioSourceManager ());
41+ if (sources .isSoundcloud ()) audioPlayerManager .registerSourceManager (new SoundCloudAudioSourceManager (serverConfig . isSoundcloudSearchEnabled () ));
4242 if (sources .isTwitch ()) audioPlayerManager .registerSourceManager (new TwitchStreamAudioSourceManager ());
4343 if (sources .isVimeo ()) audioPlayerManager .registerSourceManager (new VimeoAudioSourceManager ());
4444 if (sources .isMixer ()) audioPlayerManager .registerSourceManager (new BeamAudioSourceManager ());
Original file line number Diff line number Diff line change @@ -38,6 +38,8 @@ public class ServerConfig {
3838 @ Nullable
3939 private Integer youtubePlaylistLoadLimit ;
4040 private boolean gcWarnings = true ;
41+ private boolean youtubeSearchEnabled = true ;
42+ private boolean soundcloudSearchEnabled = true ;
4143
4244 public String getPassword () {
4345 return password ;
@@ -84,4 +86,20 @@ public boolean isGcWarnings() {
8486 public void setGcWarnings (boolean gcWarnings ) {
8587 this .gcWarnings = gcWarnings ;
8688 }
89+
90+ public boolean isYoutubeSearchEnabled () {
91+ return youtubeSearchEnabled ;
92+ }
93+
94+ public void setYoutubeSearchEnabled (boolean youtubeSearchEnabled ) {
95+ this .youtubeSearchEnabled = youtubeSearchEnabled ;
96+ }
97+
98+ public boolean isSoundcloudSearchEnabled () {
99+ return soundcloudSearchEnabled ;
100+ }
101+
102+ public void setSoundcloudSearchEnabled (boolean soundcloudSearchEnabled ) {
103+ this .soundcloudSearchEnabled = soundcloudSearchEnabled ;
104+ }
87105}
You can’t perform that action at this time.
0 commit comments