Skip to content

Commit 23b8ff2

Browse files
committed
Allow for scsearch to be turned off
1 parent 7aa0cf0 commit 23b8ff2

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

LavalinkServer/application.yml.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ lavalink:
1919
bufferDurationMs: 400
2020
youtubePlaylistLoadLimit: 6 # Number of pages at 100 each
2121
youtubeSearchEnabled: true
22+
soundcloudSearchEnabled: true
2223
gc-warnings: true
2324

2425
metrics:

LavalinkServer/src/main/java/lavalink/server/config/AudioPlayerConfiguration.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public Supplier<AudioPlayerManager> audioPlayerManagerSupplier(AudioSourcesConfi
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());

LavalinkServer/src/main/java/lavalink/server/config/ServerConfig.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public class ServerConfig {
3939
private Integer youtubePlaylistLoadLimit;
4040
private boolean gcWarnings = true;
4141
private boolean youtubeSearchEnabled = true;
42+
private boolean soundcloudSearchEnabled = true;
4243

4344
public String getPassword() {
4445
return password;
@@ -93,4 +94,12 @@ public boolean isYoutubeSearchEnabled() {
9394
public void setYoutubeSearchEnabled(boolean youtubeSearchEnabled) {
9495
this.youtubeSearchEnabled = youtubeSearchEnabled;
9596
}
97+
98+
public boolean isSoundcloudSearchEnabled() {
99+
return soundcloudSearchEnabled;
100+
}
101+
102+
public void setSoundcloudSearchEnabled(boolean soundcloudSearchEnabled) {
103+
this.soundcloudSearchEnabled = soundcloudSearchEnabled;
104+
}
96105
}

0 commit comments

Comments
 (0)