|
|
@ -158,8 +158,10 @@ class BookInfoViewModel(application: Application) : BaseViewModel(application) { |
|
|
|
chapters |
|
|
|
chapters |
|
|
|
) |
|
|
|
) |
|
|
|
book.durChapterTitle = chapters[book.durChapterIndex].title |
|
|
|
book.durChapterTitle = chapters[book.durChapterIndex].title |
|
|
|
|
|
|
|
if (inBookshelf) { |
|
|
|
App.db.bookDao().insert(book) |
|
|
|
App.db.bookDao().insert(book) |
|
|
|
App.db.bookChapterDao().insert(*chapters.toTypedArray()) |
|
|
|
App.db.bookChapterDao().insert(*chapters.toTypedArray()) |
|
|
|
|
|
|
|
} |
|
|
|
bookData.postValue(book) |
|
|
|
bookData.postValue(book) |
|
|
|
chapterListData.postValue(chapters) |
|
|
|
chapterListData.postValue(chapters) |
|
|
|
} |
|
|
|
} |
|
|
|