mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-09-10 14:53:13 +02:00
Fix chapters with 1 page not marked as read
This commit is contained in:
parent
5cfd5da338
commit
5ad06df4ac
@ -336,14 +336,19 @@ class ReaderPresenter : BasePresenter<ReaderActivity>() {
|
|||||||
* over the chapter read like saving progress
|
* over the chapter read like saving progress
|
||||||
*/
|
*/
|
||||||
fun onChapterLeft() {
|
fun onChapterLeft() {
|
||||||
val pages = chapter.pages ?: return
|
|
||||||
|
|
||||||
// Reference these locally because they are needed later from another thread.
|
// Reference these locally because they are needed later from another thread.
|
||||||
val chapter = chapter
|
val chapter = chapter
|
||||||
val prevChapter = prevChapter
|
val prevChapter = prevChapter
|
||||||
|
|
||||||
|
val pages = chapter.pages ?: return
|
||||||
|
|
||||||
Observable
|
Observable
|
||||||
.fromCallable {
|
.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) {
|
if (!chapter.isDownloaded) {
|
||||||
source.let { if (it is OnlineSource) it.savePageList(chapter, pages) }
|
source.let { if (it is OnlineSource) it.savePageList(chapter, pages) }
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user