|
|
@ -296,14 +296,12 @@ class BookInfoViewModel(application: Application) : BaseViewModel(application) { |
|
|
|
|
|
|
|
|
|
|
|
fun changeToLocalBook(bookUrl: String) { |
|
|
|
fun changeToLocalBook(bookUrl: String) { |
|
|
|
appDb.bookDao.getBook(bookUrl)?.let { localBook -> |
|
|
|
appDb.bookDao.getBook(bookUrl)?.let { localBook -> |
|
|
|
|
|
|
|
isImportBookOnLine = false |
|
|
|
|
|
|
|
inBookshelf = true |
|
|
|
LocalBook.mergeBook(localBook, bookData.value).let { |
|
|
|
LocalBook.mergeBook(localBook, bookData.value).let { |
|
|
|
bookData.postValue(it) |
|
|
|
bookData.postValue(it) |
|
|
|
|
|
|
|
loadChapter(it) |
|
|
|
} |
|
|
|
} |
|
|
|
LocalBook.getChapterList(localBook).let { |
|
|
|
|
|
|
|
chapterListData.postValue(it) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
isImportBookOnLine = false |
|
|
|
|
|
|
|
inBookshelf = true |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|