mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-20 05:19:16 +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() {
|
fun deleteAllCachedCovers() {
|
||||||
GlobalScope.launch(Dispatchers.IO) {
|
GlobalScope.launch(Dispatchers.IO) {
|
||||||
val directory = onlineCoverDirectory
|
val directory = onlineCoverDirectory
|
||||||
val size = DiskUtil.getDirectorySize(directory)
|
|
||||||
|
|
||||||
var deletedSize = 0L
|
var deletedSize = 0L
|
||||||
val files =
|
val files =
|
||||||
directory.listFiles()?.sortedBy { it.lastModified() }?.iterator() ?: return@launch
|
directory.listFiles()?.sortedBy { it.lastModified() }?.iterator() ?: return@launch
|
||||||
@ -117,7 +115,10 @@ class CoverCache(val context: Context) {
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
context.imageLoader.memoryCache.clear()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
lastClean = System.currentTimeMillis()
|
lastClean = System.currentTimeMillis()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ class CoilSetup(context: Context) {
|
|||||||
.allowHardware(false)
|
.allowHardware(false)
|
||||||
.componentRegistry {
|
.componentRegistry {
|
||||||
if (Build.VERSION.SDK_INT >= 28) {
|
if (Build.VERSION.SDK_INT >= 28) {
|
||||||
add(ImageDecoderDecoder())
|
add(ImageDecoderDecoder(context))
|
||||||
} else {
|
} else {
|
||||||
add(GifDecoder())
|
add(GifDecoder())
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user