From 9339ea41962c5a8d8317eb973b25b7dc39b15843 Mon Sep 17 00:00:00 2001 From: arkon Date: Fri, 28 Apr 2023 16:01:14 -0400 Subject: [PATCH] Process chapter duplicates after sorting Closes #9255, sort of. The example is a bad edge case though, where chapter numbers are repeated across versions, so realistically only the first 113 will appear but the later 113(s) won't despite being "different". Those realistically should be in different manga entries, not all mixed together, so this is just a crappy source. --- .../kanade/tachiyomi/ui/reader/ReaderViewModel.kt | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderViewModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderViewModel.kt index d1f6760b5..3e0ea3201 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderViewModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderViewModel.kt @@ -172,16 +172,17 @@ class ReaderViewModel( } } else -> chapters - }.run { - if (readerPreferences.skipDupe().get()) { - removeDuplicates(selectedChapter) - } else { - this - } } chaptersForReader .sortedWith(getChapterSort(manga, sortDescending = false)) + .run { + if (readerPreferences.skipDupe().get()) { + removeDuplicates(selectedChapter) + } else { + this + } + } .map { it.toDbChapter() } .map(::ReaderChapter) }