From 0212defc3b2e83689884d4bb3dba53a45ca126e7 Mon Sep 17 00:00:00 2001 From: kunfei Date: Sun, 21 Jul 2019 09:26:20 +0800 Subject: [PATCH] up --- app/src/main/java/io/legado/app/model/WebBook.kt | 11 +++++++++++ 1 file changed, 11 insertions(+) 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)