|
|
@ -199,12 +199,16 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) { |
|
|
|
fun saveRead() { |
|
|
|
fun saveRead() { |
|
|
|
execute { |
|
|
|
execute { |
|
|
|
bookData.value?.let { book -> |
|
|
|
bookData.value?.let { book -> |
|
|
|
|
|
|
|
book.durChapterTime = System.currentTimeMillis() |
|
|
|
book.durChapterIndex = durChapterIndex |
|
|
|
book.durChapterIndex = durChapterIndex |
|
|
|
book.durChapterPos = durPageIndex |
|
|
|
book.durChapterPos = durPageIndex |
|
|
|
|
|
|
|
curTextChapter?.let { |
|
|
|
|
|
|
|
book.durChapterTitle = it.title |
|
|
|
App.db.bookDao().update(book) |
|
|
|
App.db.bookDao().update(book) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fun removeFromBookshelf(success: (() -> Unit)?) { |
|
|
|
fun removeFromBookshelf(success: (() -> Unit)?) { |
|
|
|
execute { |
|
|
|
execute { |
|
|
|