|
|
@ -26,10 +26,8 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) { |
|
|
|
val bookUrl = intent.getStringExtra("bookUrl") |
|
|
|
val bookUrl = intent.getStringExtra("bookUrl") |
|
|
|
if (!bookUrl.isNullOrEmpty()) { |
|
|
|
if (!bookUrl.isNullOrEmpty()) { |
|
|
|
execute { |
|
|
|
execute { |
|
|
|
App.db.bookDao().getBook(bookUrl).let { |
|
|
|
App.db.bookDao().getBook(bookUrl)?.let { book -> |
|
|
|
bookData.postValue(it) |
|
|
|
bookData.postValue(book) |
|
|
|
} |
|
|
|
|
|
|
|
bookData.value?.let { book -> |
|
|
|
|
|
|
|
bookSource = App.db.bookSourceDao().getBookSource(book.origin) |
|
|
|
bookSource = App.db.bookSourceDao().getBookSource(book.origin) |
|
|
|
bookSource?.let { |
|
|
|
bookSource?.let { |
|
|
|
webBook = WebBook(it) |
|
|
|
webBook = WebBook(it) |
|
|
|