Use Compose on BrowseSourceScreens (#7901)

This commit is contained in:
Andreas
2022-08-31 20:41:35 +02:00
committed by GitHub
parent bb54a81ef0
commit d4b764fa31
51 changed files with 1760 additions and 2024 deletions

View File

@@ -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
*