Skip to content

Commit 5695de0

Browse files
committed
Release v1.3.3
1 parent 9561422 commit 5695de0

File tree

4 files changed

+33
-5
lines changed

4 files changed

+33
-5
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ Note that the issue will be automatically closed if you do not fill out the titl
2323
---
2424

2525
## Device information
26-
- Suwayomi-JUI version: (Example: v1.3.2)
26+
- Suwayomi-JUI version: (Example: v1.3.3)
2727
- Operating System: (Example: Ubuntu 20.04)
2828
- Desktop Environment: (Example: Gnome 40)
2929
- Server Type: (Example: Internal)
30-
- Client JVM version: (Example: Java 17.0.1 or JUI Installer)
31-
- Server JVM version: (Example: Same as Client or OpenJDK 8u281)
30+
- Client JVM version: (Example: Java 17.0.10 or JUI Installer)
31+
- Server JVM version: (Example: Same as Client or OpenJDK 8u301)
3232

3333
## Steps to reproduce
3434
1. First Step

build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ plugins {
2828

2929
allprojects {
3030
group = "ca.gosyer"
31-
version = "1.3.2"
31+
version = "1.3.3"
3232

3333
dependencies {
3434
modules {

buildSrc/src/main/kotlin/Config.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import org.gradle.api.JavaVersion
22

33
object Config {
4-
const val migrationCode = 4
4+
const val migrationCode = 5
55

66
// Suwayomi-Server version
77
const val tachideskVersion = "v1.0.0"

desktop/src/main/kotlin/ca/gosyer/jui/desktop/AppMigrations.kt

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,22 @@
66

77
package ca.gosyer.jui.desktop
88

9+
import ca.gosyer.appdirs.AppDirs
910
import ca.gosyer.jui.desktop.build.BuildConfig
1011
import ca.gosyer.jui.domain.migration.service.MigrationPreferences
1112
import ca.gosyer.jui.uicore.vm.ContextWrapper
1213
import me.tatarka.inject.annotations.Inject
14+
import okio.FileSystem
15+
import okio.Path.Companion.toPath
16+
import org.lighthousegames.logging.logging
1317

1418
class AppMigrations
1519
@Inject
1620
constructor(
1721
private val migrationPreferences: MigrationPreferences,
1822
private val contextWrapper: ContextWrapper,
1923
) {
24+
@Suppress("KotlinConstantConditions")
2025
fun runMigrations(): Boolean {
2126
val oldVersion = migrationPreferences.appVersion().get()
2227
if (oldVersion < BuildConfig.MIGRATION_CODE) {
@@ -26,8 +31,31 @@ class AppMigrations
2631
if (oldVersion == 0) {
2732
return false
2833
}
34+
35+
if (oldVersion < 5) {
36+
val oldDir = AppDirs("Tachidesk-JUI").getUserDataDir().toPath()
37+
val newDir = AppDirs("Suwayomi-JUI").getUserDataDir().toPath()
38+
try {
39+
FileSystem.SYSTEM.list(oldDir)
40+
.filter { FileSystem.SYSTEM.metadata(it).isDirectory }
41+
.forEach { path ->
42+
runCatching {
43+
FileSystem.SYSTEM.atomicMove(path, newDir / path.name)
44+
}.onFailure {
45+
log.e(it) { "Failed to move directory ${path.name}" }
46+
}
47+
}
48+
} catch (e: Exception) {
49+
log.e(e) { "Failed to run directory migration" }
50+
}
51+
}
52+
2953
return true
3054
}
3155
return false
3256
}
57+
58+
companion object {
59+
private val log = logging()
60+
}
3361
}

0 commit comments

Comments
 (0)