update updateLog.md

pull/831/head 3.21.012611
gedoor 4 years ago
parent 9c5559775b
commit 3b597ac9ee
  1. 16
      app/src/main/java/io/legado/app/service/CheckSourceService.kt

@ -107,7 +107,21 @@ class CheckSourceService : BaseService() {
fun check(source: BookSource) { fun check(source: BookSource) {
execute(context = searchCoroutine) { execute(context = searchCoroutine) {
val webBook = WebBook(source) val webBook = WebBook(source)
val books = webBook.searchBookAwait(this, CheckSource.keyword) var books = webBook.searchBookAwait(this, CheckSource.keyword)
if (books.isEmpty()) {
val exs = source.getExploreKinds()
if (exs.isEmpty()) {
throw Exception("搜索内容为空并且没有发现")
}
var url: String? = null
for (ex in exs) {
url = ex.url
if (!url.isNullOrBlank()) {
break
}
}
books = webBook.exploreBookAwait(this, url!!)
}
val book = webBook.getBookInfoAwait(this, books.first().toBook()) val book = webBook.getBookInfoAwait(this, books.first().toBook())
val toc = webBook.getChapterListAwait(this, book) val toc = webBook.getChapterListAwait(this, book)
val content = webBook.getContentAwait(this, book, toc.first()) val content = webBook.getContentAwait(this, book, toc.first())

Loading…
Cancel
Save