mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-12-23 18:51:51 +01:00
clear coil memory cache when clearing non library covers
This commit is contained in:
parent
91498139da
commit
9ac99023d9
@ -99,8 +99,6 @@ class CoverCache(val context: Context) {
|
||||
fun deleteAllCachedCovers() {
|
||||
GlobalScope.launch(Dispatchers.IO) {
|
||||
val directory = onlineCoverDirectory
|
||||
val size = DiskUtil.getDirectorySize(directory)
|
||||
|
||||
var deletedSize = 0L
|
||||
val files =
|
||||
directory.listFiles()?.sortedBy { it.lastModified() }?.iterator() ?: return@launch
|
||||
@ -117,7 +115,10 @@ class CoverCache(val context: Context) {
|
||||
)
|
||||
)
|
||||
}
|
||||
context.imageLoader.memoryCache.clear()
|
||||
|
||||
}
|
||||
|
||||
lastClean = System.currentTimeMillis()
|
||||
}
|
||||
|
||||
|
@ -19,7 +19,7 @@ class CoilSetup(context: Context) {
|
||||
.allowHardware(false)
|
||||
.componentRegistry {
|
||||
if (Build.VERSION.SDK_INT >= 28) {
|
||||
add(ImageDecoderDecoder())
|
||||
add(ImageDecoderDecoder(context))
|
||||
} else {
|
||||
add(GifDecoder())
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user