From 27fbe93df6e949bb97b7b85c4cb4c1f51015d492 Mon Sep 17 00:00:00 2001 From: Michael Rittmeister Date: Tue, 1 Aug 2023 21:57:49 +0200 Subject: [PATCH] Make search provider configurable --- music/build.gradle.kts | 2 +- .../src/main/kotlin/dev/schlaubi/mikmusic/core/Config.kt | 1 + .../schlaubi/mikmusic/musicchannel/MusicInteractionModule.kt | 3 ++- .../kotlin/dev/schlaubi/mikmusic/player/queue/TrackFinder.kt | 3 ++- 4 files changed, 6 insertions(+), 3 deletions(-) diff --git a/music/build.gradle.kts b/music/build.gradle.kts index db28540bc..7ee97cc75 100644 --- a/music/build.gradle.kts +++ b/music/build.gradle.kts @@ -1,3 +1,3 @@ subprojects { - version = "3.0.5-SNAPSHOT" + version = "3.0.6-SNAPSHOT" } diff --git a/music/player/src/main/kotlin/dev/schlaubi/mikmusic/core/Config.kt b/music/player/src/main/kotlin/dev/schlaubi/mikmusic/core/Config.kt index 20471d17f..8657fe5e3 100644 --- a/music/player/src/main/kotlin/dev/schlaubi/mikmusic/core/Config.kt +++ b/music/player/src/main/kotlin/dev/schlaubi/mikmusic/core/Config.kt @@ -9,4 +9,5 @@ object Config : EnvironmentConfig("") { val SPOTIFY_CLIENT_ID by getEnv("") val SPOTIFY_CLIENT_SECRET by getEnv("") val IMAGE_COLOR_SERVICE_URL by environment.optional() + val DEFAULT_SEARCH_PROVIDER by getEnv("ytsearch") } diff --git a/music/player/src/main/kotlin/dev/schlaubi/mikmusic/musicchannel/MusicInteractionModule.kt b/music/player/src/main/kotlin/dev/schlaubi/mikmusic/musicchannel/MusicInteractionModule.kt index a8b5d696c..c7b8d6da3 100644 --- a/music/player/src/main/kotlin/dev/schlaubi/mikmusic/musicchannel/MusicInteractionModule.kt +++ b/music/player/src/main/kotlin/dev/schlaubi/mikmusic/musicchannel/MusicInteractionModule.kt @@ -18,6 +18,7 @@ import dev.schlaubi.mikbot.plugin.api.module.MikBotModule import dev.schlaubi.mikbot.plugin.api.util.* import dev.schlaubi.mikmusic.checks.joinSameChannelCheck import dev.schlaubi.mikmusic.checks.musicControlCheck +import dev.schlaubi.mikmusic.core.Config import dev.schlaubi.mikmusic.core.MusicModule import dev.schlaubi.mikmusic.core.checkOtherSchedulerOptions import dev.schlaubi.mikmusic.core.settings.MusicSettingsDatabase @@ -150,7 +151,7 @@ suspend fun Link.takeFirstMatch(musicPlayer: MusicPlayer, query: String): List