mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-21 20:47:03 -05:00
Consider sort direction when downloading next n chapters (fixes #4916)
This commit is contained in:
parent
8882cd4787
commit
41a747c7e7
1 changed files with 11 additions and 5 deletions
|
@ -1004,11 +1004,17 @@ class MangaController :
|
||||||
|
|
||||||
// OVERFLOW MENU DIALOGS
|
// OVERFLOW MENU DIALOGS
|
||||||
|
|
||||||
private fun getUnreadChaptersSorted() = 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 }
|
||||||
.reversed()
|
.distinctBy { it.name }
|
||||||
|
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…
Reference in a new issue