Fix wrong sources count if NSFW sources are disabled

This commit is contained in:
Zakhar Timoshenko
2024-02-18 23:56:19 +03:00
parent 8cc04b0f7a
commit 325a8be484

View File

@@ -57,7 +57,7 @@ class MangaSourcesRepository @Inject constructor(
observeIsNsfwDisabled(),
dao.observeEnabled(SourcesSortOrder.MANUAL),
) { skipNsfw, sources ->
sources.count { skipNsfw || !MangaSource(it.source).isNsfw() }
sources.count { !skipNsfw || !MangaSource(it.source).isNsfw() }
}.distinctUntilChanged()
}