Fetch download counts if library is filtered by downloaded

Fixes #8277

(cherry picked from commit 9792a6cb780d0db3a962fdf2e60ef028b3ceb07f)

# Conflicts:
#	app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryPresenter.kt
This commit is contained in:
arkon 2022-10-23 10:15:05 -04:00 committed by Jobobby04
parent dc6215dd3b
commit 8231aa45d7

View File

@ -495,13 +495,14 @@ class LibraryPresenter(
val libraryMangasFlow = combine( val libraryMangasFlow = combine(
getLibraryManga.subscribe(), getLibraryManga.subscribe(),
libraryPreferences.downloadBadge().changes(), libraryPreferences.downloadBadge().changes(),
libraryPreferences.filterDownloaded().changes(),
downloadCache.changes, downloadCache.changes,
) { libraryMangaList, downloadBadgePref, _ -> ) { libraryMangaList, downloadBadgePref, filterDownloadedPref, _ ->
libraryMangaList libraryMangaList
.map { libraryManga -> .map { libraryManga ->
// Display mode based on user preference: take it from global library setting or category // Display mode based on user preference: take it from global library setting or category
LibraryItem(libraryManga).apply { LibraryItem(libraryManga).apply {
downloadCount = if (downloadBadgePref) { downloadCount = if (downloadBadgePref || filterDownloadedPref == State.INCLUDE.value) {
// SY --> // SY -->
if (libraryManga.manga.source == MERGED_SOURCE_ID) { if (libraryManga.manga.source == MERGED_SOURCE_ID) {
runBlocking { runBlocking {