Fix bug when pressing download unread chapters on a E-Hentai manga from library will download the latest chapter even if its read

This commit is contained in:
Jobobby04 2020-08-05 13:32:11 -04:00
parent eb3c9a1d58
commit 76adeae5ed

View File

@ -357,7 +357,7 @@ class LibraryPresenter(
launchIO {
/* SY --> */ val chapters = if (manga.source == EH_SOURCE_ID || manga.source == EXH_SOURCE_ID) {
val chapter = db.getChapters(manga).executeAsBlocking().minBy { it.source_order }
if (chapter != null) listOf(chapter) else emptyList()
if (chapter != null && !chapter.read) listOf(chapter) else emptyList()
} else /* SY <-- */ db.getChapters(manga).executeAsBlocking()
.filter { !it.read }