From 774cedb7960a034d4d6d8aa99683dc915e0cdebe Mon Sep 17 00:00:00 2001 From: Xwite <1797350009@qq.com> Date: Mon, 7 Feb 2022 13:08:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=AF=8F=E6=AC=A1=E6=A0=A1=E9=AA=8C=E5=A4=B1?= =?UTF-8?q?=E6=95=88=E9=83=BD=E5=BA=94=E8=AF=A5=E6=9B=B4=E6=96=B0=E6=BA=90?= =?UTF-8?q?=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/legado/app/service/CheckSourceService.kt | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 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 7735fa736..31ea800b4 100644 --- a/app/src/main/java/io/legado/app/service/CheckSourceService.kt +++ b/app/src/main/java/io/legado/app/service/CheckSourceService.kt @@ -123,6 +123,11 @@ class CheckSourceService : BaseService() { searchWord = it } } + source.bookSourceComment = source.bookSourceComment + ?.split("\n\n") + ?.filterNot { + it.startsWith("Error: ") + }?.joinToString("\n") //校验搜索 用户设置校验搜索 并且 搜索链接不为空 if (CheckSource.checkSearch && !source.searchUrl.isNullOrBlank()) { val searchBooks = WebBook.searchBookAwait(this, source, searchWord) @@ -198,17 +203,10 @@ class CheckSourceService : BaseService() { is ContentEmptyException -> source.addGroup("正文失效") is TocEmptyException -> source.addGroup("目录失效") } - if (source.bookSourceComment?.contains("Error: ") == false) { - source.bookSourceComment = - "Error: ${it.localizedMessage} \n\n" + "${source.bookSourceComment}" - } + source.bookSourceComment = + "Error: ${it.localizedMessage} \n\n" + "${source.bookSourceComment}" Debug.updateFinalMessage(source.bookSourceUrl, "失败:${it.localizedMessage}") }.onSuccess(searchCoroutine) { - source.bookSourceComment = source.bookSourceComment - ?.split("\n\n") - ?.filterNot { - it.startsWith("Error: ") - }?.joinToString("\n") Debug.updateFinalMessage(source.bookSourceUrl, "校验成功") }.onFinally(searchCoroutine) { source.respondTime = Debug.getRespondTime(source.bookSourceUrl)