From 5ad06df4ac32a528f00e4eb0b4b22e5da6389893 Mon Sep 17 00:00:00 2001 From: len Date: Wed, 15 Jun 2016 16:47:59 +0200 Subject: [PATCH] Fix chapters with 1 page not marked as read --- .../eu/kanade/tachiyomi/ui/reader/ReaderPresenter.kt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderPresenter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderPresenter.kt index 58c202c8f0..a648a8ab0a 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderPresenter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderPresenter.kt @@ -336,14 +336,19 @@ class ReaderPresenter : BasePresenter() { * over the chapter read like saving progress */ fun onChapterLeft() { - val pages = chapter.pages ?: return - // Reference these locally because they are needed later from another thread. val chapter = chapter val prevChapter = prevChapter + val pages = chapter.pages ?: return + Observable .fromCallable { + // Chapters with 1 page don't trigger page changes, so mark them as read. + if (pages.size == 1) { + chapter.read = true + } + if (!chapter.isDownloaded) { source.let { if (it is OnlineSource) it.savePageList(chapter, pages) } }