Fix/server config duplicated types (#1672)

* Move "serverConfig" to "server-config" module

* Remove duplicated types

Unintentionally introduced with 8ef2877040
This commit is contained in:
schroda
2025-09-29 17:24:26 +02:00
committed by GitHub
parent 5c79672d84
commit 9062252939
8 changed files with 34 additions and 93 deletions

View File

@@ -1,7 +1,5 @@
package suwayomi.tachidesk.graphql.types
import suwayomi.tachidesk.server.serverConfig
data class AboutWebUI(
val channel: WebUIChannel,
val tag: String,
@@ -30,61 +28,3 @@ data class WebUIUpdateStatus(
val state: UpdateState,
val progress: Int,
)
enum class WebUIInterface {
BROWSER,
ELECTRON,
}
enum class WebUIChannel {
BUNDLED, // the default webUI version bundled with the server release
STABLE,
PREVIEW,
;
companion object {
fun from(channel: String): WebUIChannel = entries.find { it.name.lowercase() == channel.lowercase() } ?: STABLE
}
}
enum class WebUIFlavor(
val uiName: String,
val repoUrl: String,
val versionMappingUrl: String,
val latestReleaseInfoUrl: String,
val baseFileName: String,
) {
WEBUI(
"WebUI",
"https://github.com/Suwayomi/Suwayomi-WebUI-preview",
"https://raw.githubusercontent.com/Suwayomi/Suwayomi-WebUI/master/versionToServerVersionMapping.json",
"https://api.github.com/repos/Suwayomi/Suwayomi-WebUI-preview/releases/latest",
"Suwayomi-WebUI",
),
VUI(
"VUI",
"https://github.com/Suwayomi/Suwayomi-VUI",
"https://raw.githubusercontent.com/Suwayomi/Suwayomi-VUI/main/versionToServerVersionMapping.json",
"https://api.github.com/repos/Suwayomi/Suwayomi-VUI/releases/latest",
"Suwayomi-VUI-Web",
),
CUSTOM(
"Custom",
"repoURL",
"versionMappingUrl",
"latestReleaseInfoURL",
"baseFileName",
),
;
companion object {
val default: WebUIFlavor = WEBUI
fun from(value: String): WebUIFlavor = entries.find { it.uiName == value } ?: default
val current: WebUIFlavor
get() = serverConfig.webUIFlavor.value
}
}