From 811191e153dbdd7acb87a0a7b4e13b52567171f3 Mon Sep 17 00:00:00 2001 From: kunfei Date: Fri, 16 Aug 2019 20:24:53 +0800 Subject: [PATCH] up --- .../java/io/legado/app/ui/readbook/ReadBookViewModel.kt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/readbook/ReadBookViewModel.kt b/app/src/main/java/io/legado/app/ui/readbook/ReadBookViewModel.kt index e618f96d6..1288583a8 100644 --- a/app/src/main/java/io/legado/app/ui/readbook/ReadBookViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/readbook/ReadBookViewModel.kt @@ -49,10 +49,12 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) { fun loadContent(book: Book, index: Int) { - App.db.bookChapterDao().getChapter(book.bookUrl, index)?.let { chapter -> - BookHelp.getContent(book, chapter)?.let { + execute { + App.db.bookChapterDao().getChapter(book.bookUrl, index)?.let { chapter -> + BookHelp.getContent(book, chapter)?.let { - } ?: download(book, chapter) + } ?: download(book, chapter) + } } }