Consider sort direction when downloading next n chapters (fixes #4916)
(cherry picked from commit 41a747c7e799a6cab936e9f4a14979ca7587ef39) # Conflicts: # app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaController.kt
This commit is contained in:
parent
80a5a54e60
commit
91b49f8a0c
@ -1424,15 +1424,26 @@ class MangaController :
|
|||||||
|
|
||||||
// OVERFLOW MENU DIALOGS
|
// OVERFLOW MENU DIALOGS
|
||||||
|
|
||||||
private fun getUnreadChaptersSorted() = /* SY --> */ if (presenter.source.isEhBasedSource()) presenter.chapters
|
private fun getUnreadChaptersSorted(): List<ChapterItem> {
|
||||||
.sortedWith(presenter.getChapterSort())
|
val chapters = presenter.chapters
|
||||||
.filter { !it.read && it.status == Download.State.NOT_DOWNLOADED }
|
.sortedWith(presenter.getChapterSort())
|
||||||
.distinctBy { it.name }
|
.filter { !it.read && it.status == Download.State.NOT_DOWNLOADED }
|
||||||
else /* SY <-- */ presenter.chapters
|
.distinctBy { it.name }
|
||||||
.sortedWith(presenter.getChapterSort())
|
// SY -->
|
||||||
.filter { !it.read && it.status == Download.State.NOT_DOWNLOADED }
|
.let {
|
||||||
.distinctBy { it.name }
|
if (presenter.source.isEhBasedSource()) {
|
||||||
.reversed()
|
it.reversed()
|
||||||
|
} else {
|
||||||
|
it
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// SY <--
|
||||||
|
return if (presenter.sortDescending()) {
|
||||||
|
chapters.reversed()
|
||||||
|
} else {
|
||||||
|
chapters
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun downloadChapters(choice: Int) {
|
private fun downloadChapters(choice: Int) {
|
||||||
val chaptersToDownload = when (choice) {
|
val chaptersToDownload = when (choice) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user