Added missing sorting cases handling
Previous commit missed some cases resulting in errors at runtime
This commit is contained in:
@@ -35,3 +35,12 @@ class ChapterLoadByNumber {
|
||||
return chapters.sortedBy { it.chapter_number }
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Load strategy using the chapter upload date. This ordering ignores scanlators
|
||||
*/
|
||||
class ChapterLoadByUploadDate() {
|
||||
fun get(allChapters: List<Chapter>): List<Chapter> {
|
||||
return allChapters.sortedBy { it.date_upload }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -129,6 +129,7 @@ class ReaderPresenter(
|
||||
when (manga.sorting) {
|
||||
Manga.SORTING_SOURCE -> ChapterLoadBySource().get(chaptersForReader)
|
||||
Manga.SORTING_NUMBER -> ChapterLoadByNumber().get(chaptersForReader, selectedChapter)
|
||||
Manga.SORTING_UPLOAD_DATE -> ChapterLoadByUploadDate().get(chaptersForReader)
|
||||
else -> error("Unknown sorting method")
|
||||
}.map(::ReaderChapter)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user