mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-20 17:59:18 +01:00
Ignore a random crash when closing the reader
This commit is contained in:
parent
72ae243fa2
commit
3ce880bc62
@ -21,6 +21,7 @@ import rx.Observable
|
||||
import rx.Subscription
|
||||
import rx.android.schedulers.AndroidSchedulers
|
||||
import rx.schedulers.Schedulers
|
||||
import timber.log.Timber
|
||||
import uy.kohesive.injekt.injectLazy
|
||||
import java.io.File
|
||||
import java.util.*
|
||||
@ -349,8 +350,7 @@ class ReaderPresenter : BasePresenter<ReaderActivity>() {
|
||||
|
||||
val pages = chapter.pages ?: return
|
||||
|
||||
Observable
|
||||
.fromCallable {
|
||||
Observable.fromCallable {
|
||||
// Chapters with 1 page don't trigger page changes, so mark them as read.
|
||||
if (pages.size == 1) {
|
||||
chapter.read = true
|
||||
@ -376,8 +376,13 @@ class ReaderPresenter : BasePresenter<ReaderActivity>() {
|
||||
|
||||
db.updateChapterProgress(chapter).executeAsBlocking()
|
||||
|
||||
try {
|
||||
val history = History.create(chapter).apply { last_read = Date().time }
|
||||
db.updateHistoryLastRead(history).executeAsBlocking()
|
||||
} catch (error: Exception) {
|
||||
// TODO find out why it crashes
|
||||
Timber.e(error)
|
||||
}
|
||||
}
|
||||
.subscribeOn(Schedulers.io())
|
||||
.subscribe()
|
||||
|
Loading…
Reference in New Issue
Block a user