File tree Expand file tree Collapse file tree 3 files changed +11
-1
lines changed
src/main/java/lavalink/server/config Expand file tree Collapse file tree 3 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ lavalink:
1818 local: false
1919 bufferDurationMs: 400
2020 youtubePlaylistLoadLimit: 6 # Number of pages at 100 each
21+ youtubeSearchEnabled: true
2122 gc-warnings: true
2223
2324metrics:
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ 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 );
Original file line number Diff line number Diff line change @@ -38,6 +38,7 @@ public class ServerConfig {
3838 @ Nullable
3939 private Integer youtubePlaylistLoadLimit ;
4040 private boolean gcWarnings = true ;
41+ private boolean youtubeSearchEnabled = true ;
4142
4243 public String getPassword () {
4344 return password ;
@@ -84,4 +85,12 @@ public boolean isGcWarnings() {
8485 public void setGcWarnings (boolean gcWarnings ) {
8586 this .gcWarnings = gcWarnings ;
8687 }
88+
89+ public boolean isYoutubeSearchEnabled () {
90+ return youtubeSearchEnabled ;
91+ }
92+
93+ public void setYoutubeSearchEnabled (boolean youtubeSearchEnabled ) {
94+ this .youtubeSearchEnabled = youtubeSearchEnabled ;
95+ }
8796}
You can’t perform that action at this time.
0 commit comments