Sort plugins by priority in UI

This commit is contained in:
grimsi
2025-06-10 13:11:36 +02:00
parent f5d9d34a2b
commit d0a1c8375e
7 changed files with 20 additions and 17 deletions
@@ -55,6 +55,14 @@ abstract class ConfigurableGameyfinPlugin(wrapper: PluginWrapper) : GameyfinPlug
}
}
override fun <T : Serializable> config(key: String): T {
val value = optionalConfig<T>(key)
if (value == null) {
throw PluginConfigError("Required configuration key '$key' is missing or has no value")
}
return value
}
private fun castConfigValue(meta: ConfigMetadata<*>, value: Any): Any? {
val expectedType = meta.type
@@ -98,14 +106,6 @@ abstract class ConfigurableGameyfinPlugin(wrapper: PluginWrapper) : GameyfinPlug
}
}
override fun <T : Serializable> config(key: String): T {
val value = optionalConfig<T>(key)
if (value == null) {
throw PluginConfigError("Required configuration key '$key' is missing or has no value")
}
return value
}
private fun resolveMetadata(key: String): ConfigMetadata<*> {
return configMetadata.find { it.key == key }
?: throw PluginConfigError("Unknown configuration key: $key")