pull/473/head
gedoor 4 years ago
parent 55bd31d803
commit dd57f397e0
  1. 4
      app/src/main/java/io/legado/app/ui/book/changesource/ChangeSourceViewModel.kt

@ -157,7 +157,7 @@ class ChangeSourceViewModel(application: Application) : BaseViewModel(applicatio
webBook.getBookInfo(book, this) webBook.getBookInfo(book, this)
.onSuccess { .onSuccess {
if (context.getPrefBoolean(PreferKey.changeSourceLoadToc)) { if (context.getPrefBoolean(PreferKey.changeSourceLoadToc)) {
loadChapter(webBook, book) loadBookToc(webBook, book)
} else { } else {
//从详情页里获取最新章节 //从详情页里获取最新章节
book.latestChapterTitle = it.latestChapterTitle book.latestChapterTitle = it.latestChapterTitle
@ -169,7 +169,7 @@ class ChangeSourceViewModel(application: Application) : BaseViewModel(applicatio
} }
} }
private fun loadChapter(webBook: WebBook, book: Book) { private fun loadBookToc(webBook: WebBook, book: Book) {
webBook.getChapterList(book, this) webBook.getChapterList(book, this)
.onSuccess(IO) { chapters -> .onSuccess(IO) { chapters ->
if (chapters.isNotEmpty()) { if (chapters.isNotEmpty()) {

Loading…
Cancel
Save