Exclude some more app state preferences from backups

(cherry picked from commit bcc42dd259cd528641ae4963b9b6ef290332bb27)

# Conflicts:
#	app/build.gradle.kts
This commit is contained in:
arkon 2023-11-21 22:11:44 -05:00 committed by Jobobby04
parent e47941ae70
commit 27c7154cdb
4 changed files with 12 additions and 5 deletions

View File

@ -52,7 +52,7 @@ object Migrations {
backupPreferences: BackupPreferences, backupPreferences: BackupPreferences,
trackerManager: TrackerManager, trackerManager: TrackerManager,
): Boolean { ): Boolean {
val lastVersionCode = preferenceStore.getInt("last_version_code", 0) val lastVersionCode = preferenceStore.getInt(Preference.appStateKey("last_version_code"), 0)
val oldVersion = lastVersionCode.get() val oldVersion = lastVersionCode.get()
if (oldVersion < BuildConfig.VERSION_CODE) { if (oldVersion < BuildConfig.VERSION_CODE) {
lastVersionCode.set(BuildConfig.VERSION_CODE) lastVersionCode.set(BuildConfig.VERSION_CODE)
@ -399,7 +399,7 @@ object Migrations {
newKey = { Preference.privateKey(it) }, newKey = { Preference.privateKey(it) },
) )
} }
if (oldVersion < 108) { if (oldVersion < 110) {
val prefsToReplace = listOf( val prefsToReplace = listOf(
"pref_download_only", "pref_download_only",
"incognito_mode", "incognito_mode",
@ -409,6 +409,9 @@ object Migrations {
"library_update_last_timestamp", "library_update_last_timestamp",
"library_unseen_updates_count", "library_unseen_updates_count",
"last_used_category", "last_used_category",
"last_app_check",
"last_ext_check",
"last_version_code",
) )
replacePreferences( replacePreferences(
preferenceStore = preferenceStore, preferenceStore = preferenceStore,

View File

@ -31,7 +31,7 @@ internal class ExtensionGithubApi {
private val json: Json by injectLazy() private val json: Json by injectLazy()
private val lastExtCheck: Preference<Long> by lazy { private val lastExtCheck: Preference<Long> by lazy {
preferenceStore.getLong("last_ext_check", 0) preferenceStore.getLong(Preference.appStateKey("last_ext_check"), 0)
} }
// SY --> // SY -->

View File

@ -623,7 +623,8 @@ object EXHMigrations {
preferenceStore.getString(key).delete() preferenceStore.getString(key).delete()
} }
} }
}
if (oldVersion under 59) {
val prefsToReplace = listOf( val prefsToReplace = listOf(
"pref_download_only", "pref_download_only",
"incognito_mode", "incognito_mode",
@ -633,6 +634,9 @@ object EXHMigrations {
"library_update_last_timestamp", "library_update_last_timestamp",
"library_unseen_updates_count", "library_unseen_updates_count",
"last_used_category", "last_used_category",
"last_app_check",
"last_ext_check",
"last_version_code",
"skip_pre_migration", "skip_pre_migration",
"eh_auto_update_stats", "eh_auto_update_stats",
) )

View File

@ -13,7 +13,7 @@ class GetApplicationRelease(
) { ) {
private val lastChecked: Preference<Long> by lazy { private val lastChecked: Preference<Long> by lazy {
preferenceStore.getLong("last_app_check", 0) preferenceStore.getLong(Preference.appStateKey("last_app_check"), 0)
} }
suspend fun await(arguments: Arguments): Result { suspend fun await(arguments: Arguments): Result {