From c2fa7c4ea13cf1e06a8113112a9ecb67582dd857 Mon Sep 17 00:00:00 2001 From: gedoor Date: Sat, 21 Aug 2021 21:51:42 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E6=A3=80=E6=9F=A5=E4=B9=A6?= =?UTF-8?q?=E6=BA=90=E8=B0=83=E8=AF=95=E4=BF=A1=E6=81=AF=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/legado/app/service/CheckSourceService.kt | 13 +++---------- .../ui/book/source/manage/BookSourceActivity.kt | 14 +++++++------- 2 files changed, 10 insertions(+), 17 deletions(-) diff --git a/app/src/main/java/io/legado/app/service/CheckSourceService.kt b/app/src/main/java/io/legado/app/service/CheckSourceService.kt index 66fcf24fc..433f36182 100644 --- a/app/src/main/java/io/legado/app/service/CheckSourceService.kt +++ b/app/src/main/java/io/legado/app/service/CheckSourceService.kt @@ -30,7 +30,6 @@ class CheckSourceService : BaseService() { private val checkedIds = ArrayList() private var processIndex = 0 private var notificationMsg = "" - private val showCheckSourceMessage = AppConfig.checkSourceMessage private val notificationBuilder by lazy { NotificationCompat.Builder(this, AppConst.channelIdReadAloud) .setSmallIcon(R.drawable.ic_network_check) @@ -109,9 +108,7 @@ class CheckSourceService : BaseService() { fun check(source: BookSource) { execute(context = searchCoroutine) { - if (showCheckSourceMessage) { - Debug.startChecking(source) - } + Debug.startChecking(source) val webBook = WebBook(source) var books = webBook.searchBookAwait(this, CheckSource.keyword) if (books.isEmpty()) { @@ -141,9 +138,7 @@ class CheckSourceService : BaseService() { "error:${it.localizedMessage} ${source.bookSourceComment}" """.trimIndent() - if (showCheckSourceMessage) { - Debug.updateFinalMessage(source.bookSourceUrl, "失败") - } + Debug.updateFinalMessage(source.bookSourceUrl, "失败") appDb.bookSourceDao.update(source) }.onSuccess(searchCoroutine) { source.removeGroup("失效") @@ -152,9 +147,7 @@ class CheckSourceService : BaseService() { ?.filterNot { it.startsWith("error:") }?.joinToString("\n") - if (showCheckSourceMessage) { - Debug.updateFinalMessage(source.bookSourceUrl, "成功") - } + Debug.updateFinalMessage(source.bookSourceUrl, "成功") appDb.bookSourceDao.update(source) }.onFinally(searchCoroutine) { onNext(source.bookSourceUrl, source.bookSourceName) diff --git a/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt b/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt index 4db5082bd..2e062e490 100644 --- a/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/source/manage/BookSourceActivity.kt @@ -341,9 +341,7 @@ class BookSourceActivity : VMBaseActivity