From f2a0992a24299b1f3a89d4d76d572443533a3b2a Mon Sep 17 00:00:00 2001 From: Jason Yao Date: Thu, 16 Sep 2021 18:01:50 -0400 Subject: [PATCH] =?UTF-8?q?=E6=A0=A1=E9=AA=8C=E4=BF=AE=E5=A4=8D=E6=B3=A8?= =?UTF-8?q?=E9=87=8A=E4=B9=B1=E6=B7=BB=E5=8A=A0=E9=87=8D=E5=A4=8D=E6=B7=BB?= =?UTF-8?q?=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)