diff --git a/app/build.gradle b/app/build.gradle index fab46c0191..96c100c84b 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -38,7 +38,7 @@ android { minSdkVersion 16 targetSdkVersion 25 testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" - versionCode 18 + versionCode 19 versionName "0.4.2" buildConfigField "String", "COMMIT_COUNT", "\"${getCommitCount()}\"" diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/cache/CoverCache.kt b/app/src/main/java/eu/kanade/tachiyomi/data/cache/CoverCache.kt index ca7a1de507..dee208e0cc 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/cache/CoverCache.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/cache/CoverCache.kt @@ -20,7 +20,7 @@ class CoverCache(private val context: Context) { /** * Cache directory used for cache management. */ - private val cacheDir: File = File(context.externalCacheDir, "cover_disk_cache") + private val cacheDir = context.getExternalFilesDir("covers") /** * Returns the cover from cache. diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/main/ChangelogDialogFragment.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/main/ChangelogDialogFragment.kt index db7eee11b0..08ab144b1c 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/main/ChangelogDialogFragment.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/main/ChangelogDialogFragment.kt @@ -39,6 +39,18 @@ class ChangelogDialogFragment : DialogFragment() { // Delete internal chapter cache dir. File(context.cacheDir, "chapter_disk_cache").deleteRecursively() } + if (oldVersion < 19) { + // Move covers to external files dir. + val oldDir = File(context.externalCacheDir, "cover_disk_cache") + if (oldDir.exists()) { + val destDir = context.getExternalFilesDir("covers") + if (destDir != null) { + oldDir.listFiles().forEach { + it.renameTo(File(destDir, it.name)) + } + } + } + } } } }