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 6c66be641..448e75414 100644 --- a/app/src/main/java/io/legado/app/service/CheckSourceService.kt +++ b/app/src/main/java/io/legado/app/service/CheckSourceService.kt @@ -131,11 +131,18 @@ class CheckSourceService : BaseService() { }.timeout(180000L) .onError { source.addGroup("失效") - source.bookSourceComment = - "error:${it.localizedMessage}\n${source.bookSourceComment}" + source.bookSourceComment = """ + "error:${it.localizedMessage} + ${source.bookSourceComment}" + """.trimIndent() appDb.bookSourceDao.update(source) }.onSuccess { source.removeGroup("失效") + source.bookSourceComment = source.bookSourceComment + ?.split("\n") + ?.filterNot { + it.startsWith("error:") + }?.joinToString("\n") appDb.bookSourceDao.update(source) }.onFinally { onNext(source.bookSourceUrl, source.bookSourceName)