Small refactoring

This commit is contained in:
grimsi
2024-10-31 09:07:46 +01:00
parent f89086a06d
commit 5ebd074d3b
8 changed files with 34 additions and 40 deletions
+2
View File
@@ -13,6 +13,8 @@ dependencies {
api("org.pf4j:pf4j:${rootProject.extra["pf4jVersion"]}") {
exclude(group = "org.slf4j")
}
api("org.slf4j:slf4j-api:2.0.16")
implementation(kotlin("stdlib"))
@@ -1,7 +1,18 @@
package de.grimsi.gameyfin.pluginapi.core
interface GameyfinPlugin {
fun getConfigMetadata(): List<PluginConfigElement>
fun getCurrentConfig(): Map<String, String?>
fun loadConfig(config: Map<String, String?>)
import org.pf4j.Plugin
import org.pf4j.PluginWrapper
abstract class GameyfinPlugin(wrapper: PluginWrapper) : Plugin(wrapper) {
abstract val configMetadata: List<PluginConfigElement>
protected open var config: Map<String, String?> = emptyMap()
open fun getCurrentConfig(): Map<String, String?> {
return config
}
open fun loadConfig(config: Map<String, String?>) {
this.config = config
}
}