书源校验:同时校验搜索和发现时 搜索结果不为空时跳过校验发现的bug

pull/1575/head
Xwite 3 years ago
parent 38185f07fb
commit eee0cf1f1b
  1. 28
      app/src/main/java/io/legado/app/service/CheckSourceService.kt

@ -135,23 +135,21 @@ class CheckSourceService : BaseService() {
} }
//校验发现 //校验发现
if (CheckSource.checkDiscovery) { if (CheckSource.checkDiscovery) {
if (books.isEmpty()) { val exs = source.exploreKinds
val exs = source.exploreKinds var url: String? = null
var url: String? = null for (ex in exs) {
for (ex in exs) { url = ex.url
url = ex.url if (!url.isNullOrBlank()) {
if (!url.isNullOrBlank()) { break
break
}
}
if (url.isNullOrBlank()) {
throw NoStackTraceException("搜索内容为空并且没有发现")
}
books = WebBook.exploreBookAwait(this, source, url)
if (books.isEmpty()) {
throw NoStackTraceException("发现书籍为空")
} }
} }
if (source.hasGroup("搜索失效") && url.isNullOrBlank()) {
throw NoStackTraceException("搜索内容为空并且没有发现")
}
books = WebBook.exploreBookAwait(this, source, url)
if (books.isEmpty()) {
throw NoStackTraceException("发现书籍为空")
}
} }
//校验详情 //校验详情
if (CheckSource.checkInfo) { if (CheckSource.checkInfo) {

Loading…
Cancel
Save