Refactor GameyfinPlugin and ConfigurableGameyfinPlugin to fix SLF4J issue

This commit is contained in:
grimsi
2025-05-16 10:59:49 +02:00
parent f91b289cee
commit 9c6becb29e
9 changed files with 72 additions and 54 deletions
+12 -4
View File
@@ -8,8 +8,16 @@ plugins {
dependencies {
ksp("care.better.pf4j:pf4j-kotlin-symbol-processing:${rootProject.extra["pf4jKspVersion"]}")
implementation("io.ktor:ktor-client-core:${ktor_version}")
implementation("io.ktor:ktor-client-cio:${ktor_version}")
implementation("io.ktor:ktor-client-content-negotiation:${ktor_version}")
implementation("io.ktor:ktor-serialization-kotlinx-json:${ktor_version}")
implementation("io.ktor:ktor-client-core:${ktor_version}") {
exclude(group = "org.slf4j", module = "slf4j-api")
}
implementation("io.ktor:ktor-client-cio:${ktor_version}") {
exclude(group = "org.slf4j", module = "slf4j-api")
}
implementation("io.ktor:ktor-client-content-negotiation:${ktor_version}") {
exclude(group = "org.slf4j", module = "slf4j-api")
}
implementation("io.ktor:ktor-serialization-kotlinx-json:${ktor_version}") {
exclude(group = "org.slf4j", module = "slf4j-api")
}
}
@@ -1,7 +1,6 @@
package de.grimsi.gameyfin.plugins.steamgriddb
import de.grimsi.gameyfin.pluginapi.core.Configurable
import de.grimsi.gameyfin.pluginapi.core.GameyfinPlugin
import de.grimsi.gameyfin.pluginapi.core.ConfigurableGameyfinPlugin
import de.grimsi.gameyfin.pluginapi.core.PluginConfigElement
import de.grimsi.gameyfin.pluginapi.core.PluginConfigError
import de.grimsi.gameyfin.pluginapi.gamemetadata.GameMetadata
@@ -12,18 +11,14 @@ import de.grimsi.gameyfin.plugins.steamgriddb.dto.SteamGridDbGrid
import kotlinx.coroutines.runBlocking
import org.pf4j.Extension
import org.pf4j.PluginWrapper
import org.slf4j.Logger
import org.slf4j.LoggerFactory
import java.net.URI
class SteamGridDbPlugin(wrapper: PluginWrapper) : GameyfinPlugin(wrapper), Configurable {
class SteamGridDbPlugin(wrapper: PluginWrapper) : ConfigurableGameyfinPlugin(wrapper) {
companion object {
private var client: SteamGridDbApiClient? = null
}
val log: Logger = LoggerFactory.getLogger(javaClass)
override val configMetadata: List<PluginConfigElement> = listOf(
PluginConfigElement(
key = "apiKey",
@@ -32,7 +27,6 @@ class SteamGridDbPlugin(wrapper: PluginWrapper) : GameyfinPlugin(wrapper), Confi
isSecret = true
)
)
override var config: Map<String, String?> = emptyMap()
override fun validateConfig(config: Map<String, String?>): Boolean {
try {