pull/1282/head
gedoor 3 years ago
parent 58b8ec8f0b
commit 531a3513d1
  1. 11
      app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt

@ -22,6 +22,7 @@ import io.legado.app.data.entities.BookChapter
import io.legado.app.data.entities.BookProgress import io.legado.app.data.entities.BookProgress
import io.legado.app.help.ReadBookConfig import io.legado.app.help.ReadBookConfig
import io.legado.app.help.ReadTipConfig import io.legado.app.help.ReadTipConfig
import io.legado.app.help.storage.AppWebDav
import io.legado.app.help.storage.Backup import io.legado.app.help.storage.Backup
import io.legado.app.lib.dialogs.alert import io.legado.app.lib.dialogs.alert
import io.legado.app.lib.dialogs.selector import io.legado.app.lib.dialogs.selector
@ -881,6 +882,12 @@ class ReadBookActivity : ReadBookBaseActivity(),
backupJob?.cancel() backupJob?.cancel()
backupJob = launch { backupJob = launch {
delay(120000) delay(120000)
if (isActive) {
ReadBook.book?.let {
AppWebDav.uploadBookProgress(it)
Backup.autoBack(this@ReadBookActivity)
}
}
} }
} }
@ -990,7 +997,9 @@ class ReadBookActivity : ReadBookBaseActivity(),
if (t > 0) { if (t > 0) {
keepScreenOn(true) keepScreenOn(true)
delay(screenTimeOut) delay(screenTimeOut)
keepScreenOn(false) if (isActive) {
keepScreenOn(false)
}
} else { } else {
keepScreenOn(false) keepScreenOn(false)
} }

Loading…
Cancel
Save