From f0a190e8d2e1a0f50f6f97d85b698f4799b1d383 Mon Sep 17 00:00:00 2001 From: schroda <50052685+schroda@users.noreply.github.com> Date: Sun, 30 Jul 2023 02:26:04 +0200 Subject: [PATCH] Update to bundled webUI version if necessary (#619) In case on the startup no webUI update was available but the bundled version of the server is newer than the current used version, then the bundled version should be used. This could be the case in case a new server version was installed and no compatible webUI version is available --- .../tachidesk/server/util/WebInterfaceManager.kt | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/server/src/main/kotlin/suwayomi/tachidesk/server/util/WebInterfaceManager.kt b/server/src/main/kotlin/suwayomi/tachidesk/server/util/WebInterfaceManager.kt index b8fe8778..ca86af92 100644 --- a/server/src/main/kotlin/suwayomi/tachidesk/server/util/WebInterfaceManager.kt +++ b/server/src/main/kotlin/suwayomi/tachidesk/server/util/WebInterfaceManager.kt @@ -118,6 +118,17 @@ object WebInterfaceManager { checkForUpdate() } + // check if the bundled webUI version is a newer version than the current used version + // this could be the case in case no compatible webUI version is available and a newer server version was installed + val shouldUpdateToBundledVersion = + serverConfig.webUIFlavor == DEFAULT_WEB_UI && extractVersion(getLocalVersion(applicationDirs.webUIRoot)) < extractVersion( + BuildConfig.WEBUI_TAG + ) + if (shouldUpdateToBundledVersion) { + logger.debug { "Update to bundled version \"${BuildConfig.WEBUI_TAG}\"" } + extractBundledWebUI() + } + return }