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