diff --git a/core/src/main/kotlin/su/plo/voice/discs/PlasmoAudioPlayerManager.kt b/core/src/main/kotlin/su/plo/voice/discs/PlasmoAudioPlayerManager.kt index bc8d9b4..2c84162 100644 --- a/core/src/main/kotlin/su/plo/voice/discs/PlasmoAudioPlayerManager.kt +++ b/core/src/main/kotlin/su/plo/voice/discs/PlasmoAudioPlayerManager.kt @@ -219,7 +219,7 @@ class PlasmoAudioPlayerManager : PluginKoinComponent { plugin.slF4JLogger.info("YouTube clients: {}", youtubeClients) lavaPlayerManager.registerSourceManager( - YoutubeAudioSourceManager(true, *youtubeClients.map { it.client }.toTypedArray()) + YoutubeAudioSourceManager(true, *youtubeClients.map { it.client.get() }.toTypedArray()) .also { source -> proxyHttpBuilder?.let { source.httpInterfaceManager.configureBuilder(it) } diff --git a/core/src/main/kotlin/su/plo/voice/discs/config/YoutubeClient.kt b/core/src/main/kotlin/su/plo/voice/discs/config/YoutubeClient.kt index 90551ae..020d52c 100644 --- a/core/src/main/kotlin/su/plo/voice/discs/config/YoutubeClient.kt +++ b/core/src/main/kotlin/su/plo/voice/discs/config/YoutubeClient.kt @@ -11,18 +11,19 @@ import su.plo.voice.lavaplayer.libs.dev.lavalink.youtube.clients.TvHtml5Embedded import su.plo.voice.lavaplayer.libs.dev.lavalink.youtube.clients.Web import su.plo.voice.lavaplayer.libs.dev.lavalink.youtube.clients.WebEmbedded import su.plo.voice.lavaplayer.libs.dev.lavalink.youtube.clients.skeleton.Client +import java.util.function.Supplier enum class YoutubeClient( - val client: Client + val client: Supplier ) { - MUSIC(Music()), - WEB(Web()), - WEBEMBEDDED(WebEmbedded()), - ANDROID(Android()), - ANDROID_VR(AndroidVr()), - ANDROID_TESTSUITE(AndroidTestsuite()), - ANDROID_MUSIC(AndroidMusic()), - MEDIA_CONNECT(MediaConnect()), - IOS(Ios()), - TVHTML5EMBEDDED(TvHtml5Embedded()) + MUSIC({ Music() }), + WEB({ Web() }), + WEBEMBEDDED({ WebEmbedded() }), + ANDROID({ Android() }), + ANDROID_VR({ AndroidVr() }), + ANDROID_TESTSUITE({ AndroidTestsuite() }), + ANDROID_MUSIC({ AndroidMusic() }), + MEDIA_CONNECT({ MediaConnect() }), + IOS({ Ios() }), + TVHTML5EMBEDDED({ TvHtml5Embedded() }) } \ No newline at end of file