mirror of
https://github.com/gedoor/legado.git
synced 2025-08-10 00:52:30 +00:00
Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -124,26 +124,31 @@ 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) {
|
||||
val exs = source.exploreKinds
|
||||
var url: String? = null
|
||||
for (ex in exs) {
|
||||
url = ex.url
|
||||
if (!url.isNullOrBlank()) {
|
||||
break
|
||||
}
|
||||
}
|
||||
if (source.hasGroup("搜索失效") && url.isNullOrBlank()) {
|
||||
throw NoStackTraceException("搜索内容为空并且没有发现")
|
||||
}
|
||||
books = WebBook.exploreBookAwait(this, source, url)
|
||||
if (books.isEmpty()) {
|
||||
val exs = source.exploreKinds
|
||||
var url: String? = null
|
||||
for (ex in exs) {
|
||||
url = ex.url
|
||||
if (!url.isNullOrBlank()) {
|
||||
break
|
||||
}
|
||||
}
|
||||
if (url.isNullOrBlank()) {
|
||||
throw NoStackTraceException("搜索内容为空并且没有发现")
|
||||
}
|
||||
books = WebBook.exploreBookAwait(this, source, url)
|
||||
if (books.isEmpty()) {
|
||||
throw NoStackTraceException("发现书籍为空")
|
||||
}
|
||||
throw NoStackTraceException("发现书籍为空")
|
||||
}
|
||||
}
|
||||
//校验详情
|
||||
|
||||
Reference in New Issue
Block a user