pull/1771/head
kunfei 3 years ago
parent d5e7d05e47
commit 0aa87f3fde
  1. 1
      app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt
  2. 2
      app/src/main/java/io/legado/app/ui/book/info/BookInfoViewModel.kt

@ -54,7 +54,6 @@ class BookInfoActivity :
viewModel.bookData.value?.let { book -> viewModel.bookData.value?.let { book ->
launch { launch {
withContext(IO) { withContext(IO) {
viewModel.durChapterIndex = it.first
book.durChapterIndex = it.first book.durChapterIndex = it.first
book.durChapterPos = it.second book.durChapterPos = it.second
appDb.bookDao.update(book) appDb.bookDao.update(book)

@ -27,7 +27,6 @@ import kotlinx.coroutines.Dispatchers.IO
class BookInfoViewModel(application: Application) : BaseViewModel(application) { class BookInfoViewModel(application: Application) : BaseViewModel(application) {
val bookData = MutableLiveData<Book>() val bookData = MutableLiveData<Book>()
val chapterListData = MutableLiveData<List<BookChapter>>() val chapterListData = MutableLiveData<List<BookChapter>>()
var durChapterIndex = 0
var inBookshelf = false var inBookshelf = false
var bookSource: BookSource? = null var bookSource: BookSource? = null
private var changeSourceCoroutine: Coroutine<*>? = null private var changeSourceCoroutine: Coroutine<*>? = null
@ -70,7 +69,6 @@ class BookInfoViewModel(application: Application) : BaseViewModel(application) {
private fun upBook(book: Book) { private fun upBook(book: Book) {
execute { execute {
durChapterIndex = book.durChapterIndex
bookData.postValue(book) bookData.postValue(book)
upCoverByRule(book) upCoverByRule(book)
bookSource = if (book.isLocalBook()) null else bookSource = if (book.isLocalBook()) null else

Loading…
Cancel
Save