pull/1440/head
gedoor 4 years ago committed by RinOrz
parent f1107df91a
commit 1db1ddaa9c
  1. 4
      app/src/main/java/io/legado/app/model/webBook/SearchModel.kt

@ -79,12 +79,13 @@ class SearchModel(private val scope: CoroutineScope, private val callBack: CallB
} }
searchIndex++ searchIndex++
val source = bookSourceList[searchIndex] val source = bookSourceList[searchIndex]
searchPool?.let { searchPool ->
val task = WebBook.searchBook( val task = WebBook.searchBook(
scope, scope,
source, source,
searchKey, searchKey,
searchPage, searchPage,
context = searchPool!! context = searchPool
).timeout(30000L) ).timeout(30000L)
.onSuccess(searchPool) { .onSuccess(searchPool) {
onSuccess(searchId, it) onSuccess(searchId, it)
@ -94,6 +95,7 @@ class SearchModel(private val scope: CoroutineScope, private val callBack: CallB
} }
tasks.add(task) tasks.add(task)
} }
}
@Synchronized @Synchronized
private fun onSuccess(searchId: Long, items: ArrayList<SearchBook>) { private fun onSuccess(searchId: Long, items: ArrayList<SearchBook>) {

Loading…
Cancel
Save