书源校验:只校验搜索时 搜索结果为空应该抛出异常

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

@ -124,7 +124,14 @@ class CheckSourceService : BaseService() {
//校验搜索 用户设置校验搜索 并且 搜索链接不为空
if (CheckSource.checkSearch && !source.searchUrl.isNullOrBlank()) {
books = WebBook.searchBookAwait(this, source, searchWord)
if (books.isEmpty()) source.addGroup("搜索失效") else source.removeGroup("搜索失效")
if (books.isEmpty()) {
source.addGroup("搜索失效")
if (!CheckSource.checkDiscovery) {
throw NoStackTraceException("搜索书籍为空")
}
} else {
source.removeGroup("搜索失效")
}
}
//校验发现
if (CheckSource.checkDiscovery) {

Loading…
Cancel
Save