From bcc42dd259cd528641ae4963b9b6ef290332bb27 Mon Sep 17 00:00:00 2001 From: arkon Date: Tue, 21 Nov 2023 22:11:44 -0500 Subject: [PATCH] Exclude some more app state preferences from backups --- app/build.gradle.kts | 2 +- app/src/main/java/eu/kanade/tachiyomi/Migrations.kt | 7 +++++-- .../kanade/tachiyomi/extension/api/ExtensionGithubApi.kt | 2 +- .../domain/release/interactor/GetApplicationRelease.kt | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 135931545..4bba73d1d 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -22,7 +22,7 @@ android { defaultConfig { applicationId = "eu.kanade.tachiyomi" - versionCode = 109 + versionCode = 110 versionName = "0.14.7" buildConfigField("String", "COMMIT_COUNT", "\"${getCommitCount()}\"") diff --git a/app/src/main/java/eu/kanade/tachiyomi/Migrations.kt b/app/src/main/java/eu/kanade/tachiyomi/Migrations.kt index f38dd415c..c55ce35da 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/Migrations.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/Migrations.kt @@ -50,7 +50,7 @@ object Migrations { backupPreferences: BackupPreferences, trackerManager: TrackerManager, ): Boolean { - val lastVersionCode = preferenceStore.getInt("last_version_code", 0) + val lastVersionCode = preferenceStore.getInt(Preference.appStateKey("last_version_code"), 0) val oldVersion = lastVersionCode.get() if (oldVersion < BuildConfig.VERSION_CODE) { lastVersionCode.set(BuildConfig.VERSION_CODE) @@ -396,7 +396,7 @@ object Migrations { newKey = { Preference.privateKey(it) }, ) } - if (oldVersion < 108) { + if (oldVersion < 110) { val prefsToReplace = listOf( "pref_download_only", "incognito_mode", @@ -406,6 +406,9 @@ object Migrations { "library_update_last_timestamp", "library_unseen_updates_count", "last_used_category", + "last_app_check", + "last_ext_check", + "last_version_code", ) replacePreferences( preferenceStore = preferenceStore, diff --git a/app/src/main/java/eu/kanade/tachiyomi/extension/api/ExtensionGithubApi.kt b/app/src/main/java/eu/kanade/tachiyomi/extension/api/ExtensionGithubApi.kt index f2a1c25ed..6d34d9e52 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/extension/api/ExtensionGithubApi.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/extension/api/ExtensionGithubApi.kt @@ -28,7 +28,7 @@ internal class ExtensionGithubApi { private val json: Json by injectLazy() private val lastExtCheck: Preference by lazy { - preferenceStore.getLong("last_ext_check", 0) + preferenceStore.getLong(Preference.appStateKey("last_ext_check"), 0) } private var requiresFallbackSource = false diff --git a/domain/src/main/java/tachiyomi/domain/release/interactor/GetApplicationRelease.kt b/domain/src/main/java/tachiyomi/domain/release/interactor/GetApplicationRelease.kt index 113e48af3..2f7709f39 100644 --- a/domain/src/main/java/tachiyomi/domain/release/interactor/GetApplicationRelease.kt +++ b/domain/src/main/java/tachiyomi/domain/release/interactor/GetApplicationRelease.kt @@ -13,7 +13,7 @@ class GetApplicationRelease( ) { private val lastChecked: Preference by lazy { - preferenceStore.getLong("last_app_check", 0) + preferenceStore.getLong(Preference.appStateKey("last_app_check"), 0) } suspend fun await(arguments: Arguments): Result {