Remove download all chapters menu item

Users can still select all the chapters (long press + select all) to download them.
This commit is contained in:
arkon
2023-03-07 22:38:27 -05:00
parent bebd4be43d
commit 09acc53483
6 changed files with 3 additions and 15 deletions

View File

@@ -524,13 +524,6 @@ class MangaInfoScreenModel(
}
}
/**
* Returns the list of filtered or all chapter items if [skipFiltered] is false.
*/
private fun getChapterItems(): List<ChapterItem> {
return if (skipFiltered) filteredChapters.orEmpty().toList() else allChapters.orEmpty()
}
/**
* Returns the next unread chapter or null if everything is read.
*/
@@ -540,7 +533,8 @@ class MangaInfoScreenModel(
}
private fun getUnreadChapters(): List<Chapter> {
return getChapterItems()
val chapterItems = if (skipFiltered) filteredChapters.orEmpty().toList() else allChapters.orEmpty()
return chapterItems
.filter { (chapter, dlStatus) -> !chapter.read && dlStatus == Download.State.NOT_DOWNLOADED }
.map { it.chapter }
}
@@ -613,7 +607,6 @@ class MangaInfoScreenModel(
DownloadAction.NEXT_10_CHAPTERS -> getUnreadChaptersSorted().take(10)
DownloadAction.NEXT_25_CHAPTERS -> getUnreadChaptersSorted().take(25)
DownloadAction.UNREAD_CHAPTERS -> getUnreadChapters()
DownloadAction.ALL_CHAPTERS -> getChapterItems().map { it.chapter }
}
if (chaptersToDownload.isNotEmpty()) {
startDownload(chaptersToDownload, false)