Fix local covers not showing in details

This commit is contained in:
Jay 2020-05-10 19:43:03 -04:00
parent 5f6210b263
commit 76d82eb336
2 changed files with 3 additions and 2 deletions

View File

@ -344,7 +344,7 @@ class MangaDetailsController : BaseController,
activity?.window?.statusBarColor = translucentColor
}
}
getHeader()?.updateCover(presenter.manga, true)
getHeader()?.updateCover(presenter.manga)
}
override fun onLoadCleared(placeholder: Drawable?) {}

View File

@ -307,7 +307,7 @@ class MangaHeaderHolder(
}
}
fun updateCover(manga: Manga, force: Boolean = false) {
fun updateCover(manga: Manga) {
if (!isCached(manga)) return
GlideApp.with(view.context).load(manga).diskCacheStrategy(DiskCacheStrategy.RESOURCE)
.signature(ObjectKey(MangaImpl.getLastCoverFetch(manga.id!!).toString()))
@ -318,6 +318,7 @@ class MangaHeaderHolder(
}
private fun isCached(manga: Manga): Boolean {
if (manga.source == LocalSource.ID) return true
val coverCache = adapter.delegate.mangaPresenter().coverCache
manga.thumbnail_url?.let {
return if (manga.favorite) coverCache.getCoverFile(it).exists()