Added missing chapters count in MangaInfoHeader (#9184)

* Added missing chapters count in MangaInfoHeader

* Added "Might be missing chapters"

* Added missing chapters to MangaAndSourceTitlesLarge function

* Removed comments

* Reworked getMissingChapters to countMissingChapters, moved -1 check

* Attempting detecting sub-chapters

* Moved MissingChapters to ChapterHeader; Adapted design to fit in

* Fixed block comment in one-line-element

* Fixed critical missing-chapter counting bug

* Undid unintentional & unnecessary changes

* Moved & refactored countMissingChapters

* Fixed import order; Mapping chapter object to chapterNumber

* Optimized "No (valid) chapters" detection

---------

Co-authored-by: arkon <arkon@users.noreply.github.com>
This commit is contained in:
Felix Kaiser
2023-03-25 03:44:58 +01:00
committed by GitHub
parent da25322572
commit f94d902bb6
4 changed files with 87 additions and 0 deletions
@@ -65,6 +65,7 @@ import eu.kanade.tachiyomi.ui.manga.chapterDecimalFormat
import eu.kanade.tachiyomi.util.lang.toRelativeString
import eu.kanade.tachiyomi.util.system.copyToClipboard
import tachiyomi.domain.chapter.model.Chapter
import tachiyomi.domain.chapter.service.countMissingChapters
import tachiyomi.domain.manga.model.Manga
import tachiyomi.domain.source.model.StubSource
import tachiyomi.presentation.core.components.LazyColumn
@@ -393,6 +394,7 @@ private fun MangaScreenSmallImpl(
ChapterHeader(
enabled = chapters.fastAll { !it.selected },
chapterCount = chapters.size,
missingChapters = countMissingChapters(chapters.map { it.chapter.chapterNumber }),
onClick = onFilterClicked,
)
}
@@ -604,6 +606,7 @@ fun MangaScreenLargeImpl(
ChapterHeader(
enabled = chapters.fastAll { !it.selected },
chapterCount = chapters.size,
missingChapters = countMissingChapters(chapters.map { it.chapter.chapterNumber }),
onClick = onFilterButtonClicked,
)
}