E/ExHentai manga fab, dont return chapter if its already read

This commit is contained in:
Jobobby04 2020-07-29 20:31:25 -04:00
parent 4286fd606a
commit acf2ad7c77

View File

@ -644,7 +644,8 @@ class MangaPresenter(
*/ */
fun getNextUnreadChapter(): ChapterItem? { fun getNextUnreadChapter(): ChapterItem? {
return if (source.isEhBasedSource()) { return if (source.isEhBasedSource()) {
chapters.sortedBy { it.source_order }.getOrNull(0) val chapter = chapters.sortedBy { it.source_order }.getOrNull(0)
if (chapter?.read == false) chapter else null
} else { } else {
chapters.sortedByDescending { it.source_order }.find { !it.read } chapters.sortedByDescending { it.source_order }.find { !it.read }
} }