mirror of
https://github.com/Suwayomi/TachideskJUI.git
synced 2025-12-17 18:22:04 +01:00
Release v1.3.3
This commit is contained in:
6
.github/ISSUE_TEMPLATE/bug_report.md
vendored
6
.github/ISSUE_TEMPLATE/bug_report.md
vendored
@@ -23,12 +23,12 @@ Note that the issue will be automatically closed if you do not fill out the titl
|
|||||||
---
|
---
|
||||||
|
|
||||||
## Device information
|
## Device information
|
||||||
- Suwayomi-JUI version: (Example: v1.3.2)
|
- Suwayomi-JUI version: (Example: v1.3.3)
|
||||||
- Operating System: (Example: Ubuntu 20.04)
|
- Operating System: (Example: Ubuntu 20.04)
|
||||||
- Desktop Environment: (Example: Gnome 40)
|
- Desktop Environment: (Example: Gnome 40)
|
||||||
- Server Type: (Example: Internal)
|
- Server Type: (Example: Internal)
|
||||||
- Client JVM version: (Example: Java 17.0.1 or JUI Installer)
|
- Client JVM version: (Example: Java 17.0.10 or JUI Installer)
|
||||||
- Server JVM version: (Example: Same as Client or OpenJDK 8u281)
|
- Server JVM version: (Example: Same as Client or OpenJDK 8u301)
|
||||||
|
|
||||||
## Steps to reproduce
|
## Steps to reproduce
|
||||||
1. First Step
|
1. First Step
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ plugins {
|
|||||||
|
|
||||||
allprojects {
|
allprojects {
|
||||||
group = "ca.gosyer"
|
group = "ca.gosyer"
|
||||||
version = "1.3.2"
|
version = "1.3.3"
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
modules {
|
modules {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import org.gradle.api.JavaVersion
|
import org.gradle.api.JavaVersion
|
||||||
|
|
||||||
object Config {
|
object Config {
|
||||||
const val migrationCode = 4
|
const val migrationCode = 5
|
||||||
|
|
||||||
// Suwayomi-Server version
|
// Suwayomi-Server version
|
||||||
const val tachideskVersion = "v1.0.0"
|
const val tachideskVersion = "v1.0.0"
|
||||||
|
|||||||
@@ -6,10 +6,14 @@
|
|||||||
|
|
||||||
package ca.gosyer.jui.desktop
|
package ca.gosyer.jui.desktop
|
||||||
|
|
||||||
|
import ca.gosyer.appdirs.AppDirs
|
||||||
import ca.gosyer.jui.desktop.build.BuildConfig
|
import ca.gosyer.jui.desktop.build.BuildConfig
|
||||||
import ca.gosyer.jui.domain.migration.service.MigrationPreferences
|
import ca.gosyer.jui.domain.migration.service.MigrationPreferences
|
||||||
import ca.gosyer.jui.uicore.vm.ContextWrapper
|
import ca.gosyer.jui.uicore.vm.ContextWrapper
|
||||||
import me.tatarka.inject.annotations.Inject
|
import me.tatarka.inject.annotations.Inject
|
||||||
|
import okio.FileSystem
|
||||||
|
import okio.Path.Companion.toPath
|
||||||
|
import org.lighthousegames.logging.logging
|
||||||
|
|
||||||
class AppMigrations
|
class AppMigrations
|
||||||
@Inject
|
@Inject
|
||||||
@@ -17,6 +21,7 @@ class AppMigrations
|
|||||||
private val migrationPreferences: MigrationPreferences,
|
private val migrationPreferences: MigrationPreferences,
|
||||||
private val contextWrapper: ContextWrapper,
|
private val contextWrapper: ContextWrapper,
|
||||||
) {
|
) {
|
||||||
|
@Suppress("KotlinConstantConditions")
|
||||||
fun runMigrations(): Boolean {
|
fun runMigrations(): Boolean {
|
||||||
val oldVersion = migrationPreferences.appVersion().get()
|
val oldVersion = migrationPreferences.appVersion().get()
|
||||||
if (oldVersion < BuildConfig.MIGRATION_CODE) {
|
if (oldVersion < BuildConfig.MIGRATION_CODE) {
|
||||||
@@ -26,8 +31,31 @@ class AppMigrations
|
|||||||
if (oldVersion == 0) {
|
if (oldVersion == 0) {
|
||||||
return false
|
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 true
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
companion object {
|
||||||
|
private val log = logging()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user