|
|
@ -150,6 +150,9 @@ class BookInfoViewModel(application: Application) : BaseViewModel(application) { |
|
|
|
bookSource?.let { bookSource -> |
|
|
|
bookSource?.let { bookSource -> |
|
|
|
WebBook.getBookInfo(this, bookSource, book, canReName = canReName) |
|
|
|
WebBook.getBookInfo(this, bookSource, book, canReName = canReName) |
|
|
|
.onSuccess(IO) { |
|
|
|
.onSuccess(IO) { |
|
|
|
|
|
|
|
appDb.bookDao.getBook(book.name, book.author)?.let { |
|
|
|
|
|
|
|
inBookshelf = true |
|
|
|
|
|
|
|
} |
|
|
|
bookData.postValue(book) |
|
|
|
bookData.postValue(book) |
|
|
|
if (isImportBookOnLine) { |
|
|
|
if (isImportBookOnLine) { |
|
|
|
appDb.searchBookDao.update(book.toSearchBook()) |
|
|
|
appDb.searchBookDao.update(book.toSearchBook()) |
|
|
|