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