From f2a0992a24299b1f3a89d4d76d572443533a3b2a Mon Sep 17 00:00:00 2001 From: Jason Yao Date: Thu, 16 Sep 2021 18:01:50 -0400 Subject: [PATCH 1/2] =?UTF-8?q?=E6=A0=A1=E9=AA=8C=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=B3=A8=E9=87=8A=E4=B9=B1=E6=B7=BB=E5=8A=A0=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/legado/app/service/CheckSourceService.kt | 11 +++++------ 1 file changed, 5 insertions(+), 6 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 864f63a9a..6df5dc8d0 100644 --- a/app/src/main/java/io/legado/app/service/CheckSourceService.kt +++ b/app/src/main/java/io/legado/app/service/CheckSourceService.kt @@ -142,19 +142,18 @@ class CheckSourceService : BaseService() { }.timeout(180000L) .onError(searchCoroutine) { source.addGroup("失效") - source.bookSourceComment = """ - "error:${it.localizedMessage} - ${source.bookSourceComment}" - """.trimIndent() + if (source.bookSourceComment?.contains("Error: ") == false) { + source.bookSourceComment = "Error: ${it.localizedMessage} \n\n" + "${source.bookSourceComment}" + } Debug.updateFinalMessage(source.bookSourceUrl, "失败:${it.localizedMessage}") source.respondTime = Debug.getRespondTime(source.bookSourceUrl) appDb.bookSourceDao.update(source) }.onSuccess(searchCoroutine) { source.removeGroup("失效") source.bookSourceComment = source.bookSourceComment - ?.split("\n") + ?.split("\n\n") ?.filterNot { - it.startsWith("error:") + it.startsWith("Error: ") }?.joinToString("\n") Debug.updateFinalMessage(source.bookSourceUrl, "成功") source.respondTime = Debug.getRespondTime(source.bookSourceUrl) From 8ac3663151f9c9041758b80c7d3eb4755a91b3c0 Mon Sep 17 00:00:00 2001 From: Jason Yao Date: Thu, 16 Sep 2021 18:10:52 -0400 Subject: [PATCH 2/2] =?UTF-8?q?=E5=A6=82=E6=9E=9C=E6=9C=AC=E6=9D=A5?= =?UTF-8?q?=E6=9C=89query=EF=BC=8C=E6=A0=A1=E9=AA=8C=E7=BB=93=E6=9D=9F?= =?UTF-8?q?=E4=B8=8D=E8=87=AA=E5=8A=A8=E7=AD=9B=E9=80=89=E5=A4=B1=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/legado/app/ui/book/source/manage/BookSourceActivity.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 2340552d0..60b2948f0 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 @@ -467,7 +467,7 @@ class BookSourceActivity : VMBaseActivity - if (group.contains("失效")) { + if (group.contains("失效") && searchView.query.isEmpty()) { searchView.setQuery("失效", true) toastOnUi("发现有失效书源,已为您自动筛选!") }