|
|
@ -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()) |
|
|
|