From 76d82eb336ba940691973e3d1d936fbb4275c457 Mon Sep 17 00:00:00 2001 From: Jay Date: Sun, 10 May 2020 19:43:03 -0400 Subject: [PATCH] Fix local covers not showing in details --- .../eu/kanade/tachiyomi/ui/manga/MangaDetailsController.kt | 2 +- .../java/eu/kanade/tachiyomi/ui/manga/MangaHeaderHolder.kt | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaDetailsController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaDetailsController.kt index f5b8e1909a..86bfdbaced 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaDetailsController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaDetailsController.kt @@ -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?) {} diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaHeaderHolder.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaHeaderHolder.kt index d8e2feb1a7..46c6d274a7 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaHeaderHolder.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaHeaderHolder.kt @@ -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()