pull/1319/head 3.21.090920
gedoor 3 years ago
parent 805120d76a
commit a95804c153
  1. 6
      app/src/main/java/io/legado/app/model/webBook/SearchModel.kt
  2. 1
      app/src/main/java/io/legado/app/ui/book/search/SearchViewModel.kt

@ -91,11 +91,11 @@ class SearchModel(private val scope: CoroutineScope, private val callBack: CallB
}
@Synchronized
private fun onSuccess(searchId: Long, searchBooks: ArrayList<SearchBook>) {
private fun onSuccess(searchId: Long, items: ArrayList<SearchBook>) {
if (searchId == mSearchId) {
appDb.searchBookDao.insert(*items.toTypedArray())
val precision = appCtx.getPrefBoolean(PreferKey.precisionSearch)
appDb.searchBookDao.insert(*searchBooks.toTypedArray())
mergeItems(scope, searchBooks, precision)
mergeItems(scope, items, precision)
callBack.onSearchSuccess(searchBooks)
}
}

@ -59,6 +59,7 @@ class SearchViewModel(application: Application) : BaseViewModel(application), Se
isLoading = true
}
@Synchronized
override fun onSearchSuccess(searchBooks: ArrayList<SearchBook>) {
this.searchBooks = searchBooks
upAdapter()

Loading…
Cancel
Save