|
|
@ -183,6 +183,9 @@ class BookInfoViewModel(application: Application) : BaseViewModel(application) { |
|
|
|
bookData.value!!.changeTo(newBook, toc) |
|
|
|
bookData.value!!.changeTo(newBook, toc) |
|
|
|
bookData.postValue(newBook) |
|
|
|
bookData.postValue(newBook) |
|
|
|
chapterListData.postValue(toc) |
|
|
|
chapterListData.postValue(toc) |
|
|
|
|
|
|
|
if (inBookshelf) { |
|
|
|
|
|
|
|
appDb.bookChapterDao.insert(*toc.toTypedArray()) |
|
|
|
|
|
|
|
} |
|
|
|
}.onFinally { |
|
|
|
}.onFinally { |
|
|
|
postEvent(EventBus.SOURCE_CHANGED, newBook.bookUrl) |
|
|
|
postEvent(EventBus.SOURCE_CHANGED, newBook.bookUrl) |
|
|
|
} |
|
|
|
} |
|
|
|