From 9ce11a5b87b647e4cd31bea254814e8596fa05d1 Mon Sep 17 00:00:00 2001 From: kunfei Date: Sun, 28 Jul 2019 11:06:28 +0800 Subject: [PATCH] up --- app/src/main/java/io/legado/app/model/WebBook.kt | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) 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 00b646ad1..4f5f07e89 100644 --- a/app/src/main/java/io/legado/app/model/WebBook.kt +++ b/app/src/main/java/io/legado/app/model/WebBook.kt @@ -13,23 +13,12 @@ import io.legado.app.model.webbook.BookList class WebBook(private val bookSource: BookSource) { - fun searchBook(key: String, page: Int?): Coroutine> { + fun searchBook(key: String, page: Int?, isSearch: Boolean = true): Coroutine> { return Coroutine.async { bookSource.getSearchRule().searchUrl?.let { searchUrl -> val analyzeUrl = AnalyzeUrl(searchUrl, key, page, baseUrl = bookSource.bookSourceUrl) val response = analyzeUrl.getResponseAsync().await() - return@let BookList.analyzeBookList(response, bookSource, analyzeUrl) - } - return@async arrayListOf() - } - } - - 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@let BookList.analyzeBookList(response, bookSource, analyzeUrl, false) + return@let BookList.analyzeBookList(response, bookSource, analyzeUrl, isSearch) } return@async arrayListOf() }