diff --git a/app/src/main/java/io/legado/app/model/SearchBook.kt b/app/src/main/java/io/legado/app/model/SearchBook.kt index 7b344e60f..f70d931a2 100644 --- a/app/src/main/java/io/legado/app/model/SearchBook.kt +++ b/app/src/main/java/io/legado/app/model/SearchBook.kt @@ -1,5 +1,25 @@ package io.legado.app.model -class SearchBook { +import io.legado.app.data.entities.BookSource +import io.legado.app.help.AppConfig +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.asCoroutineDispatcher +import java.util.concurrent.Executors + +class SearchBook(scope: CoroutineScope, callBack: CallBack) { + private var searchPool = + Executors.newFixedThreadPool(AppConfig.threadCount).asCoroutineDispatcher() + private var searchId = System.currentTimeMillis() + private var searchPage = 1 + private var searchKey: String = "" + private val searchEngines = arrayListOf() + + + private data class SearchEngine(val bookSource: BookSource, var hasMore: Boolean = true) + + interface CallBack { + fun onSearchSuccess() + fun onSearchFinish() + } } \ No newline at end of file