Release v1.3.3

This commit is contained in:
Syer10
2024-03-30 21:16:22 -04:00
parent 9561422b32
commit 5695de055f
4 changed files with 33 additions and 5 deletions

View File

@@ -23,12 +23,12 @@ Note that the issue will be automatically closed if you do not fill out the titl
---
## Device information
- Suwayomi-JUI version: (Example: v1.3.2)
- Suwayomi-JUI version: (Example: v1.3.3)
- Operating System: (Example: Ubuntu 20.04)
- Desktop Environment: (Example: Gnome 40)
- Server Type: (Example: Internal)
- Client JVM version: (Example: Java 17.0.1 or JUI Installer)
- Server JVM version: (Example: Same as Client or OpenJDK 8u281)
- Client JVM version: (Example: Java 17.0.10 or JUI Installer)
- Server JVM version: (Example: Same as Client or OpenJDK 8u301)
## Steps to reproduce
1. First Step

View File

@@ -28,7 +28,7 @@ plugins {
allprojects {
group = "ca.gosyer"
version = "1.3.2"
version = "1.3.3"
dependencies {
modules {

View File

@@ -1,7 +1,7 @@
import org.gradle.api.JavaVersion
object Config {
const val migrationCode = 4
const val migrationCode = 5
// Suwayomi-Server version
const val tachideskVersion = "v1.0.0"

View File

@@ -6,10 +6,14 @@
package ca.gosyer.jui.desktop
import ca.gosyer.appdirs.AppDirs
import ca.gosyer.jui.desktop.build.BuildConfig
import ca.gosyer.jui.domain.migration.service.MigrationPreferences
import ca.gosyer.jui.uicore.vm.ContextWrapper
import me.tatarka.inject.annotations.Inject
import okio.FileSystem
import okio.Path.Companion.toPath
import org.lighthousegames.logging.logging
class AppMigrations
@Inject
@@ -17,6 +21,7 @@ class AppMigrations
private val migrationPreferences: MigrationPreferences,
private val contextWrapper: ContextWrapper,
) {
@Suppress("KotlinConstantConditions")
fun runMigrations(): Boolean {
val oldVersion = migrationPreferences.appVersion().get()
if (oldVersion < BuildConfig.MIGRATION_CODE) {
@@ -26,8 +31,31 @@ class AppMigrations
if (oldVersion == 0) {
return false
}
if (oldVersion < 5) {
val oldDir = AppDirs("Tachidesk-JUI").getUserDataDir().toPath()
val newDir = AppDirs("Suwayomi-JUI").getUserDataDir().toPath()
try {
FileSystem.SYSTEM.list(oldDir)
.filter { FileSystem.SYSTEM.metadata(it).isDirectory }
.forEach { path ->
runCatching {
FileSystem.SYSTEM.atomicMove(path, newDir / path.name)
}.onFailure {
log.e(it) { "Failed to move directory ${path.name}" }
}
}
} catch (e: Exception) {
log.e(e) { "Failed to run directory migration" }
}
}
return true
}
return false
}
companion object {
private val log = logging()
}
}