Fix local covers not showing in details
This commit is contained in:
parent
5f6210b263
commit
76d82eb336
2 changed files with 3 additions and 2 deletions
|
@ -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?) {}
|
||||
|
|
|
@ -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()
|
||||
|
|
Reference in a new issue