Compare commits

...

3 Commits

Author SHA1 Message Date
Syer10
f40dcafb43 Release v1.1.1 2024-06-15 13:15:00 -04:00
schroda
d9cb54b285 Compare webUI version with bundled webUI version (#969)
* Compare webUI version with bundled webUI version

The bundled webUI version was incorrectly compared with the minimum server version.
This worked until the latest release, because the bundled webUI version had a lower revision number than the server revision, however, with the latest release, it is now higher, resulting in no compatible webUI version to be found

* Consider bundled webUI version only for default flavor

* Add "isDefault" util function to WebUIFlavor
2024-06-15 13:05:39 -04:00
schroda
f738a162d3 Support for "STABLEPREVIEW" webUI version (#970)
Makes it possible to release new stable webUI versions without having to update the mapping file.
2024-06-15 13:05:28 -04:00
4 changed files with 22 additions and 14 deletions

View File

@@ -23,7 +23,7 @@ Note that the issue will be automatically closed if you do not fill out the titl
---
## Device information
- Suwayomi-Server version: (Example: v1.1.0-r1532-win32)
- Suwayomi-Server version: (Example: v1.1.1-r1535-win32)
- Server Operating System: (Example: Ubuntu 20.04)
- Server Desktop Environment: N/A or (Example: Gnome 40)
- Server JVM version: bundled with win32 or (Example: Java 8 Update 281 or OpenJDK 8u281)

View File

@@ -1,3 +1,11 @@
# Server: v1.1.1 + WevUI: v1.1.0
## TL;DR
- WebUI update bugfixes
## Suwayomi-Server Changelog
- ([r1534](https://github.com/Suwayomi/Suwayomi-Server/commit/d9cb54b28593e4df87522090f03a6e5b9c7d9fa2)) Compare webUI version with bundled webUI version ([#969](https://github.com/Suwayomi/Suwayomi-Server/pull/969) by @schroda)
- ([r1533](https://github.com/Suwayomi/Suwayomi-Server/commit/f738a162d3cd4582612d4986b3d3887e1c309bdd)) Support for "STABLEPREVIEW" webUI version ([#970](https://github.com/Suwayomi/Suwayomi-Server/pull/970) by @schroda)
# Server: v1.1.0 + WevUI: v1.1.0
## TL;DR
- Update Manga Info in browse

View File

@@ -10,7 +10,7 @@ import java.io.BufferedReader
const val MainClass = "suwayomi.tachidesk.MainKt"
// should be bumped with each stable release
val tachideskVersion = System.getenv("ProductVersion") ?: "v1.1.0"
val tachideskVersion = System.getenv("ProductVersion") ?: "v1.1.1"
val webUIRevisionTag = System.getenv("WebUIRevision") ?: "r1689"

View File

@@ -136,6 +136,8 @@ enum class WebUIFlavor(
}
}
fun WebUIFlavor.isDefault(): Boolean = this == WebUIFlavor.default
object WebInterfaceManager {
private val logger = KotlinLogging.logger {}
private val scope = CoroutineScope(SupervisorJob() + Dispatchers.Default)
@@ -314,10 +316,7 @@ object WebInterfaceManager {
// 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 =
flavor.uiName == WebUIFlavor.default.uiName && extractVersion(getLocalVersion()) <
extractVersion(
BuildConfig.WEBUI_TAG,
)
flavor.isDefault() && extractVersion(getLocalVersion()) < extractVersion(BuildConfig.WEBUI_TAG)
if (shouldUpdateToBundledVersion) {
log.debug { "update to bundled version \"${BuildConfig.WEBUI_TAG}\"" }
@@ -375,7 +374,7 @@ object WebInterfaceManager {
return
}
if (flavor.uiName != WebUIFlavor.default.uiName) {
if (!flavor.isDefault()) {
log.warn { "fallback to default webUI \"${WebUIFlavor.default.uiName}\"" }
serverConfig.webUIFlavor.value = WebUIFlavor.default.uiName
@@ -597,24 +596,25 @@ object WebInterfaceManager {
?: throw Exception("Invalid mappingFile")
val minServerVersionNumber = extractVersion(minServerVersionString)
// is a STABLE webUI release, without a specified webUI version, which requires same handling as the PREVIEW release
val isUnknownStableVersion = webUIVersion == "STABLEPREVIEW"
if (!WebUIChannel.doesConfigChannelEqual(WebUIChannel.from(webUIVersion))) {
// allow only STABLE versions for STABLE channel
if (WebUIChannel.doesConfigChannelEqual(WebUIChannel.STABLE)) {
if (WebUIChannel.doesConfigChannelEqual(WebUIChannel.STABLE) && !isUnknownStableVersion) {
continue
}
// allow all versions for PREVIEW channel
}
if (webUIVersion == WebUIChannel.PREVIEW.name) {
if (webUIVersion == WebUIChannel.PREVIEW.name || isUnknownStableVersion) {
webUIVersion = fetchPreviewVersion(flavor)
}
val isCompatibleVersion =
minServerVersionNumber <= currentServerVersionNumber && minServerVersionNumber >=
extractVersion(
BuildConfig.WEBUI_TAG,
)
val isNewerThanBundled =
!flavor.isDefault() || extractVersion(webUIVersion) >= extractVersion(BuildConfig.WEBUI_TAG)
val isCompatibleVersion = minServerVersionNumber <= currentServerVersionNumber && isNewerThanBundled
if (isCompatibleVersion) {
return webUIVersion
}