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

View File

@@ -6,6 +6,8 @@ import eu.kanade.tachiyomi.data.database.models.Manga
import eu.kanade.tachiyomi.data.preference.PreferencesHelper
import eu.kanade.tachiyomi.source.LocalSource
import eu.kanade.tachiyomi.source.model.SManga
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get
import java.util.Date
fun Manga.isLocal() = source == LocalSource.ID
@@ -36,7 +38,7 @@ fun Manga.prepUpdateCover(coverCache: CoverCache, remoteManga: SManga, refreshSa
}
}
fun Manga.hasCustomCover(coverCache: CoverCache): Boolean {
fun Manga.hasCustomCover(coverCache: CoverCache = Injekt.get()): Boolean {
return coverCache.getCustomCoverFile(id).exists()
}