pull/84/head
kunfei 5 years ago
parent d261d25330
commit f6daceb5c3
  1. 2
      app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt

@ -99,6 +99,7 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) {
if (book.isLocalBook()) { if (book.isLocalBook()) {
AnalyzeTxtFile.analyze(context, book).let { AnalyzeTxtFile.analyze(context, book).let {
App.db.bookChapterDao().insert(*it.toTypedArray()) App.db.bookChapterDao().insert(*it.toTypedArray())
App.db.bookDao().update(book)
ReadBook.chapterSize = it.size ReadBook.chapterSize = it.size
ReadBook.loadContent() ReadBook.loadContent()
} }
@ -108,6 +109,7 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) {
if (!cList.isNullOrEmpty()) { if (!cList.isNullOrEmpty()) {
if (changeDruChapterIndex == null) { if (changeDruChapterIndex == null) {
App.db.bookChapterDao().insert(*cList.toTypedArray()) App.db.bookChapterDao().insert(*cList.toTypedArray())
App.db.bookDao().update(book)
ReadBook.chapterSize = cList.size ReadBook.chapterSize = cList.size
ReadBook.loadContent() ReadBook.loadContent()
} else { } else {

Loading…
Cancel
Save