|
|
|
@ -25,10 +25,12 @@ import io.legado.app.ui.book.search.SearchActivity |
|
|
|
|
import io.legado.app.ui.main.bookshelf.BaseBookshelfFragment |
|
|
|
|
import io.legado.app.utils.* |
|
|
|
|
import io.legado.app.utils.viewbindingdelegate.viewBinding |
|
|
|
|
import kotlinx.coroutines.Dispatchers |
|
|
|
|
import kotlinx.coroutines.Job |
|
|
|
|
import kotlinx.coroutines.delay |
|
|
|
|
import kotlinx.coroutines.flow.catch |
|
|
|
|
import kotlinx.coroutines.flow.conflate |
|
|
|
|
import kotlinx.coroutines.flow.flowOn |
|
|
|
|
import kotlinx.coroutines.flow.map |
|
|
|
|
import kotlinx.coroutines.launch |
|
|
|
|
import kotlin.math.max |
|
|
|
@ -138,7 +140,7 @@ class BookshelfFragment2 : BaseBookshelfFragment(R.layout.fragment_bookshelf1), |
|
|
|
|
it.durChapterTime |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}.catch { |
|
|
|
|
}.flowOn(Dispatchers.Default).catch { |
|
|
|
|
AppLog.put("书架更新出错", it) |
|
|
|
|
}.conflate().collect { list -> |
|
|
|
|
books = list |
|
|
|
|