From ccadfc8fe53ff1b8ab66b0e91a4fa5a21481bcda Mon Sep 17 00:00:00 2001 From: arkon Date: Sun, 3 Dec 2023 14:58:08 -0500 Subject: [PATCH] Force recreate download index cache on upgrade Fixes #10187 --- app/build.gradle.kts | 2 +- app/src/main/java/eu/kanade/tachiyomi/Migrations.kt | 5 +++++ .../java/eu/kanade/tachiyomi/data/download/DownloadCache.kt | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/app/build.gradle.kts b/app/build.gradle.kts index 0fd4cd1fa..2f701d5a5 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -22,7 +22,7 @@ android { defaultConfig { applicationId = "eu.kanade.tachiyomi" - versionCode = 110 + versionCode = 111 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 c55ce35da..1c7887dca 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/Migrations.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/Migrations.kt @@ -416,6 +416,11 @@ object Migrations { newKey = { Preference.appStateKey(it) }, ) } + if (oldVersion < 111) { + File(context.cacheDir, "dl_index_cache") + .takeIf { it.exists() } + ?.delete() + } return true } diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadCache.kt b/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadCache.kt index 9fe7dbfee..17930a89e 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadCache.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/download/DownloadCache.kt @@ -94,7 +94,7 @@ class DownloadCache( .stateIn(scope, SharingStarted.WhileSubscribed(), false) private val diskCacheFile: File - get() = File(context.cacheDir, "dl_index_cache") + get() = File(context.cacheDir, "dl_index_cache_v2") private val rootDownloadsDirLock = Mutex() private var rootDownloadsDir = RootDirectory(provider.downloadsDir)