From 531a3513d157859ddde110357eb70aa304ea139f Mon Sep 17 00:00:00 2001 From: gedoor Date: Fri, 27 Aug 2021 07:15:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/legado/app/ui/book/read/ReadBookActivity.kt | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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) }