pull/2048/head
821938089 2 years ago
parent e233acc3af
commit af6d50be4f
  1. 4
      app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt

@ -147,13 +147,11 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) {
} }
} else { } else {
ReadBook.bookSource?.let { ReadBook.bookSource?.let {
viewModelScope.launch { viewModelScope.launch(IO) {
withContext(IO) {
val preUpdateJs = it.ruleToc?.preUpdateJs val preUpdateJs = it.ruleToc?.preUpdateJs
if (!preUpdateJs.isNullOrBlank()) { if (!preUpdateJs.isNullOrBlank()) {
AnalyzeRule(book, it).evalJS(preUpdateJs) AnalyzeRule(book, it).evalJS(preUpdateJs)
} }
}
WebBook.getChapterList(viewModelScope, it, book) WebBook.getChapterList(viewModelScope, it, book)
.onSuccess(IO) { cList -> .onSuccess(IO) { cList ->
appDb.bookChapterDao.insert(*cList.toTypedArray()) appDb.bookChapterDao.insert(*cList.toTypedArray())

Loading…
Cancel
Save