Fix download indexing with changed storage locations

Fixes #10218
This commit is contained in:
arkon
2023-12-15 18:44:37 -05:00
parent dd1a19745a
commit 36f400d542
5 changed files with 54 additions and 44 deletions

View File

@@ -381,12 +381,7 @@ object Migrations {
newKey = { Preference.privateKey(it) },
)
}
if (oldVersion < 111) {
File(context.cacheDir, "dl_index_cache")
.takeIf { it.exists() }
?.delete()
}
if (oldVersion < 112) {
if (oldVersion < 113) {
val prefsToReplace = listOf(
"pref_download_only",
"incognito_mode",
@@ -406,6 +401,9 @@ object Migrations {
filterPredicate = { it.key in prefsToReplace },
newKey = { Preference.appStateKey(it) },
)
// Deleting old download cache index files, but might as well clear it all out
context.cacheDir.deleteRecursively()
}
return true
}