diff --git a/app/src/main/java/io/legado/app/ui/book/info/BookInfoViewModel.kt b/app/src/main/java/io/legado/app/ui/book/info/BookInfoViewModel.kt index 56457a5d1..eac632df0 100644 --- a/app/src/main/java/io/legado/app/ui/book/info/BookInfoViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/book/info/BookInfoViewModel.kt @@ -118,6 +118,7 @@ class BookInfoViewModel(application: Application) : BaseViewModel(application) { if (book.isLocalBook()) { LocalBook.getChapterList(book).let { appDb.bookDao.update(book) + appDb.bookChapterDao.delByBook(book.bookUrl) appDb.bookChapterDao.insert(*it.toTypedArray()) chapterListData.postValue(it) } @@ -127,6 +128,7 @@ class BookInfoViewModel(application: Application) : BaseViewModel(application) { .onSuccess(IO) { if (inBookshelf) { appDb.bookDao.update(book) + appDb.bookChapterDao.delByBook(book.bookUrl) appDb.bookChapterDao.insert(*it.toTypedArray()) } if (changeDruChapterIndex == null) {