diff --git a/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt b/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt index 5dbaa9de3..0e7ad7e1f 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt +++ b/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.help.ReadBookConfig import io.legado.app.help.ReadTipConfig +import io.legado.app.help.storage.AppWebDav import io.legado.app.help.storage.Backup import io.legado.app.lib.dialogs.alert import io.legado.app.lib.dialogs.selector @@ -881,6 +882,12 @@ class ReadBookActivity : ReadBookBaseActivity(), backupJob?.cancel() backupJob = launch { delay(120000) + if (isActive) { + ReadBook.book?.let { + AppWebDav.uploadBookProgress(it) + Backup.autoBack(this@ReadBookActivity) + } + } } } @@ -990,7 +997,9 @@ class ReadBookActivity : ReadBookBaseActivity(), if (t > 0) { keepScreenOn(true) delay(screenTimeOut) - keepScreenOn(false) + if (isActive) { + keepScreenOn(false) + } } else { keepScreenOn(false) }