Fix read positions not being preserved

This commit is contained in:
NerdNumber9 2019-04-14 09:30:29 -04:00
parent fe5c0295c3
commit 65abb8fa6c

View File

@ -2,10 +2,12 @@ package eu.kanade.tachiyomi.ui.reader.loader
import eu.kanade.tachiyomi.data.database.models.Manga import eu.kanade.tachiyomi.data.database.models.Manga
import eu.kanade.tachiyomi.data.download.DownloadManager import eu.kanade.tachiyomi.data.download.DownloadManager
import eu.kanade.tachiyomi.data.preference.getOrDefault
import eu.kanade.tachiyomi.source.LocalSource import eu.kanade.tachiyomi.source.LocalSource
import eu.kanade.tachiyomi.source.Source import eu.kanade.tachiyomi.source.Source
import eu.kanade.tachiyomi.source.online.HttpSource import eu.kanade.tachiyomi.source.online.HttpSource
import eu.kanade.tachiyomi.ui.reader.model.ReaderChapter import eu.kanade.tachiyomi.ui.reader.model.ReaderChapter
import exh.debug.DebugFunctions.prefs
import rx.Completable import rx.Completable
import rx.Observable import rx.Observable
import rx.android.schedulers.AndroidSchedulers import rx.android.schedulers.AndroidSchedulers
@ -53,7 +55,9 @@ class ChapterLoader(
// If the chapter is partially read, set the starting page to the last the user read // If the chapter is partially read, set the starting page to the last the user read
// otherwise use the requested page. // otherwise use the requested page.
if (!chapter.chapter.read) { if (!chapter.chapter.read /* --> EH */ || prefs
.eh_preserveReadingPosition()
.getOrDefault() /* <-- EH */) {
chapter.requestedPage = chapter.chapter.last_page_read chapter.requestedPage = chapter.chapter.last_page_read
} }
} }