pull/32/head
kunfei 5 years ago
parent d4153b5d43
commit 0212defc3b
  1. 11
      app/src/main/java/io/legado/app/model/WebBook.kt

@ -21,6 +21,17 @@ class WebBook(private val bookSource: BookSource) {
} }
} }
fun findBook(key: String, page: Int?): Coroutine<List<SearchBook>> {
return Coroutine.async {
bookSource.getSearchRule().searchUrl?.let { searchUrl ->
val analyzeUrl = AnalyzeUrl(searchUrl, key, page)
val response = analyzeUrl.getResponseAsync().await()
return@async BookList.analyzeBookList(response, bookSource, analyzeUrl, false)
}
return@async arrayListOf<SearchBook>()
}
}
fun getBookInfo(book: Book): Coroutine<Book> { fun getBookInfo(book: Book): Coroutine<Book> {
return Coroutine.async { return Coroutine.async {
val analyzeUrl = AnalyzeUrl(book = book, ruleUrl = book.bookUrl) val analyzeUrl = AnalyzeUrl(book = book, ruleUrl = book.bookUrl)

Loading…
Cancel
Save