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) }.timeout(180000L)
.onError { .onError {
source.addGroup("失效") source.addGroup("失效")
source.bookSourceComment = source.bookSourceComment = """
"error:${it.localizedMessage}\n${source.bookSourceComment}" "error:${it.localizedMessage}
${source.bookSourceComment}"
""".trimIndent()
appDb.bookSourceDao.update(source) appDb.bookSourceDao.update(source)
}.onSuccess { }.onSuccess {
source.removeGroup("失效") source.removeGroup("失效")
source.bookSourceComment = source.bookSourceComment
?.split("\n")
?.filterNot {
it.startsWith("error:")
}?.joinToString("\n")
appDb.bookSourceDao.update(source) appDb.bookSourceDao.update(source)
}.onFinally { }.onFinally {
onNext(source.bookSourceUrl, source.bookSourceName) onNext(source.bookSourceUrl, source.bookSourceName)

Loading…
Cancel
Save