Add option to hide missing chapter count (#2108)

Co-authored-by: AntsyLich <59261191+AntsyLich@users.noreply.github.com>
This commit is contained in:
Danny Wu
2025-06-20 05:00:10 -04:00
committed by GitHub
parent b9e02e92be
commit d2c1ff6adf
5 changed files with 14 additions and 0 deletions

View File

@@ -256,6 +256,10 @@ object SettingsLibraryScreen : SearchableSettings {
),
title = stringResource(MR.strings.pref_mark_duplicate_read_chapter_read),
),
Preference.PreferenceItem.SwitchPreference(
preference = libraryPreferences.hideMissingChapters(),
title = stringResource(MR.strings.pref_hide_missing_chapter_indicators),
),
),
)
}

View File

@@ -230,6 +230,7 @@ class MangaScreenModel(
excludedScanlators = getExcludedScanlators.await(mangaId),
isRefreshingData = needRefreshInfo || needRefreshChapter,
dialog = null,
hideMissingChapters = libraryPreferences.hideMissingChapters().get(),
)
}
@@ -1126,6 +1127,7 @@ class MangaScreenModel(
val isRefreshingData: Boolean = false,
val dialog: Dialog? = null,
val hasPromptedToAddBefore: Boolean = false,
val hideMissingChapters: Boolean = false,
) : State {
val processedChapters by lazy {
chapters.applyFilters(manga).toList()
@@ -1136,6 +1138,10 @@ class MangaScreenModel(
}
val chapterListItems by lazy {
if (hideMissingChapters) {
return@lazy processedChapters
}
processedChapters.insertSeparators { before, after ->
val (lowerChapter, higherChapter) = if (manga.sortDescending()) {
after to before