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