diff --git a/app/src/main/java/io/legado/app/ui/book/info/BookInfoViewModel.kt b/app/src/main/java/io/legado/app/ui/book/info/BookInfoViewModel.kt index 91e412afb..9cd9ed887 100644 --- a/app/src/main/java/io/legado/app/ui/book/info/BookInfoViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/book/info/BookInfoViewModel.kt @@ -43,12 +43,16 @@ class BookInfoViewModel(application: Application) : BaseViewModel(application) { private fun setBook(book: Book) { durChapterIndex = book.durChapterIndex bookData.postValue(book) - val chapterList = App.db.bookChapterDao().getChapterList(book.bookUrl) - if (chapterList.isNotEmpty()) { - chapterListData.postValue(chapterList) - isLoadingData.postValue(false) + if (book.tocUrl.isEmpty()) { + loadBookInfo(book) } else { - loadChapter(book) + val chapterList = App.db.bookChapterDao().getChapterList(book.bookUrl) + if (chapterList.isNotEmpty()) { + chapterListData.postValue(chapterList) + isLoadingData.postValue(false) + } else { + loadChapter(book) + } } }