From 9792a6cb780d0db3a962fdf2e60ef028b3ceb07f Mon Sep 17 00:00:00 2001 From: arkon Date: Sun, 23 Oct 2022 10:15:05 -0400 Subject: [PATCH] Fetch download counts if library is filtered by downloaded Fixes #8277 --- .../java/eu/kanade/tachiyomi/ui/library/LibraryPresenter.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryPresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryPresenter.kt index 59c93a4a0..4e978ef7b 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryPresenter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryPresenter.kt @@ -340,13 +340,14 @@ class LibraryPresenter( val libraryMangasFlow = combine( getLibraryManga.subscribe(), libraryPreferences.downloadBadge().changes(), + libraryPreferences.filterDownloaded().changes(), downloadCache.changes, - ) { libraryMangaList, downloadBadgePref, _ -> + ) { libraryMangaList, downloadBadgePref, filterDownloadedPref, _ -> libraryMangaList .map { libraryManga -> // Display mode based on user preference: take it from global library setting or category LibraryItem(libraryManga).apply { - downloadCount = if (downloadBadgePref) { + downloadCount = if (downloadBadgePref || filterDownloadedPref == State.INCLUDE.value) { downloadManager.getDownloadCount(libraryManga.manga).toLong() } else { 0