mirror of
https://github.com/aniyomiorg/aniyomi.git
synced 2024-11-28 09:15:12 +03:00
Fix reader chapter sort ordering (fixes #5157)
This commit is contained in:
parent
986b709f2c
commit
065cf42aea
2 changed files with 2 additions and 4 deletions
|
@ -125,7 +125,7 @@ class ReaderPresenter(
|
||||||
}
|
}
|
||||||
|
|
||||||
chaptersForReader
|
chaptersForReader
|
||||||
.sortedWith(getChapterSort(manga))
|
.sortedWith(getChapterSort(manga, sortDescending = false))
|
||||||
.map(::ReaderChapter)
|
.map(::ReaderChapter)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -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) }
|
||||||
|
|
Loading…
Reference in a new issue