Force recreate download index cache on upgrade
Fixes #10187 (cherry picked from commit ccadfc8fe53ff1b8ab66b0e91a4fa5a21481bcda) # Conflicts: # app/build.gradle.kts
This commit is contained in:
parent
fc5021c79d
commit
3a75f7718a
@ -419,6 +419,11 @@ object Migrations {
|
|||||||
newKey = { Preference.appStateKey(it) },
|
newKey = { Preference.appStateKey(it) },
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
if (oldVersion < 111) {
|
||||||
|
File(context.cacheDir, "dl_index_cache")
|
||||||
|
.takeIf { it.exists() }
|
||||||
|
?.delete()
|
||||||
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -94,7 +94,7 @@ class DownloadCache(
|
|||||||
.stateIn(scope, SharingStarted.WhileSubscribed(), false)
|
.stateIn(scope, SharingStarted.WhileSubscribed(), false)
|
||||||
|
|
||||||
private val diskCacheFile: File
|
private val diskCacheFile: File
|
||||||
get() = File(context.cacheDir, "dl_index_cache")
|
get() = File(context.cacheDir, "dl_index_cache_v2")
|
||||||
|
|
||||||
private val rootDownloadsDirLock = Mutex()
|
private val rootDownloadsDirLock = Mutex()
|
||||||
private var rootDownloadsDir = RootDirectory(provider.downloadsDir)
|
private var rootDownloadsDir = RootDirectory(provider.downloadsDir)
|
||||||
|
@ -665,6 +665,10 @@ object EXHMigrations {
|
|||||||
filterPredicate = { it.key in privatePrefsToReplace },
|
filterPredicate = { it.key in privatePrefsToReplace },
|
||||||
newKey = { Preference.privateKey(it) },
|
newKey = { Preference.privateKey(it) },
|
||||||
)
|
)
|
||||||
|
|
||||||
|
File(context.cacheDir, "dl_index_cache")
|
||||||
|
.takeIf { it.exists() }
|
||||||
|
?.delete()
|
||||||
}
|
}
|
||||||
|
|
||||||
// if (oldVersion under 1) { } (1 is current release version)
|
// if (oldVersion under 1) { } (1 is current release version)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user