pull/1110/head
gedoor 3 years ago
parent cf2f0dbf38
commit 3da4e43656
  1. 11
      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)

Loading…
Cancel
Save