Change cover memory key (#7276)

Use different key for custom cover and add last modified time for updating
cover without clearing the whole memory cache
This commit is contained in:
Ivan Iskandar
2022-06-10 20:33:59 +07:00
committed by GitHub
parent 20c14a0a00
commit 59837bbb90
8 changed files with 42 additions and 36 deletions
@@ -1,7 +1,6 @@
package eu.kanade.tachiyomi.data.cache
import android.content.Context
import coil.imageLoader
import eu.kanade.tachiyomi.data.database.models.Manga
import eu.kanade.tachiyomi.util.storage.DiskUtil
import java.io.File
@@ -100,13 +99,6 @@ class CoverCache(private val context: Context) {
}
}
/**
* Clear coil's memory cache.
*/
fun clearMemoryCache() {
context.imageLoader.memoryCache?.clear()
}
private fun getCacheDir(dir: String): File {
return context.getExternalFilesDir(dir)
?: File(context.filesDir, dir).also { it.mkdirs() }