pull/32/head
kunfei 5 years ago
parent 00dbba3898
commit 811191e153
  1. 2
      app/src/main/java/io/legado/app/ui/readbook/ReadBookViewModel.kt

@ -49,12 +49,14 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) {
fun loadContent(book: Book, index: Int) { fun loadContent(book: Book, index: Int) {
execute {
App.db.bookChapterDao().getChapter(book.bookUrl, index)?.let { chapter -> App.db.bookChapterDao().getChapter(book.bookUrl, index)?.let { chapter ->
BookHelp.getContent(book, chapter)?.let { BookHelp.getContent(book, chapter)?.let {
} ?: download(book, chapter) } ?: download(book, chapter)
} }
} }
}
private fun download(book: Book, chapter: BookChapter) { private fun download(book: Book, chapter: BookChapter) {
webBook?.getContent(book, chapter) webBook?.getContent(book, chapter)

Loading…
Cancel
Save