Skip to content

Commit

Permalink
Release v1.3.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Syer10 committed Mar 31, 2024
1 parent 9561422 commit 5695de0
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 5 deletions.
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ plugins {

allprojects {
group = "ca.gosyer"
version = "1.3.2"
version = "1.3.3"

dependencies {
modules {
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/Config.kt
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
28 changes: 28 additions & 0 deletions desktop/src/main/kotlin/ca/gosyer/jui/desktop/AppMigrations.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,22 @@

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
constructor(
private val migrationPreferences: MigrationPreferences,
private val contextWrapper: ContextWrapper,
) {
@Suppress("KotlinConstantConditions")
fun runMigrations(): Boolean {
val oldVersion = migrationPreferences.appVersion().get()
if (oldVersion < BuildConfig.MIGRATION_CODE) {
Expand All @@ -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()
}
}

0 comments on commit 5695de0

Please sign in to comment.