diff --git a/app/src/main/java/io/legado/app/model/WebBook.kt b/app/src/main/java/io/legado/app/model/WebBook.kt index 5bd022814..6c61a8875 100644 --- a/app/src/main/java/io/legado/app/model/WebBook.kt +++ b/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> { + 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() + } + } + fun getBookInfo(book: Book): Coroutine { return Coroutine.async { val analyzeUrl = AnalyzeUrl(book = book, ruleUrl = book.bookUrl)