Fix reader chapter sort ordering (fixes #5157)

This commit is contained in:
arkon 2021-05-23 14:25:40 -04:00
parent 986b709f2c
commit 065cf42aea
2 changed files with 2 additions and 4 deletions

View File

@ -125,7 +125,7 @@ class ReaderPresenter(
} }
chaptersForReader chaptersForReader
.sortedWith(getChapterSort(manga)) .sortedWith(getChapterSort(manga, sortDescending = false))
.map(::ReaderChapter) .map(::ReaderChapter)
} }

View File

@ -3,9 +3,7 @@ package eu.kanade.tachiyomi.util.chapter
import eu.kanade.tachiyomi.data.database.models.Chapter import eu.kanade.tachiyomi.data.database.models.Chapter
import eu.kanade.tachiyomi.data.database.models.Manga import eu.kanade.tachiyomi.data.database.models.Manga
fun getChapterSort(manga: Manga): (Chapter, Chapter) -> Int { fun getChapterSort(manga: Manga, sortDescending: Boolean = manga.sortDescending()): (Chapter, Chapter) -> Int {
val sortDescending = manga.sortDescending()
return when (manga.sorting) { return when (manga.sorting) {
Manga.CHAPTER_SORTING_SOURCE -> when (sortDescending) { Manga.CHAPTER_SORTING_SOURCE -> when (sortDescending) {
true -> { c1, c2 -> c1.source_order.compareTo(c2.source_order) } true -> { c1, c2 -> c1.source_order.compareTo(c2.source_order) }