From 71ce2fe468bd958f7d5d8af56705c277911190a7 Mon Sep 17 00:00:00 2001 From: Xwite <1797350009@qq.com> Date: Mon, 7 Feb 2022 20:34:40 +0800 Subject: [PATCH] =?UTF-8?q?BookInfoViewModel.kt:loadChapter=20=E5=BA=94?= =?UTF-8?q?=E8=AF=A5=E5=85=88=E6=8A=8A=E6=97=A7=E7=9A=84chapterList?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E6=B8=85=E7=A9=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/legado/app/ui/book/info/BookInfoViewModel.kt | 2 ++ 1 file changed, 2 insertions(+) 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) {