mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-10 11:08:56 +01:00
Use Compose on BrowseSourceScreens (#7901)
This commit is contained in:
@@ -6,6 +6,7 @@ import eu.kanade.tachiyomi.util.storage.DiskUtil
|
||||
import java.io.File
|
||||
import java.io.IOException
|
||||
import java.io.InputStream
|
||||
import eu.kanade.domain.manga.model.Manga as DomainManga
|
||||
|
||||
/**
|
||||
* Class used to create cover cache.
|
||||
@@ -87,6 +88,20 @@ class CoverCache(private val context: Context) {
|
||||
return deleted
|
||||
}
|
||||
|
||||
fun deleteFromCache(manga: DomainManga, deleteCustomCover: Boolean = false): Int {
|
||||
var amountDeleted = 0
|
||||
|
||||
getCoverFile(manga.thumbnailUrl)?.let {
|
||||
if (it.exists() && it.delete()) amountDeleted++
|
||||
}
|
||||
|
||||
if (deleteCustomCover && deleteCustomCover(manga.id)) {
|
||||
amountDeleted++
|
||||
}
|
||||
|
||||
return amountDeleted
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete custom cover of the manga from the cache
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user