pull/32/head
kunfei 5 years ago
parent 20fd00f165
commit 9b8a78debf
  1. 2
      app/src/main/java/io/legado/app/ui/readbook/ReadBookViewModel.kt

@ -28,6 +28,7 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) {
bookSource = App.db.bookSourceDao().getBookSource(book.origin) bookSource = App.db.bookSourceDao().getBookSource(book.origin)
bookSource?.let { bookSource?.let {
webBook = WebBook(it) webBook = WebBook(it)
}
val count = App.db.bookChapterDao().getChapterCount(bookUrl) val count = App.db.bookChapterDao().getChapterCount(bookUrl)
if (count == 0) { if (count == 0) {
webBook?.getChapterList(book) webBook?.getChapterList(book)
@ -41,7 +42,6 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) {
chapterMaxIndex.postValue(count) chapterMaxIndex.postValue(count)
} }
} }
}
} }
} }

Loading…
Cancel
Save