From 2003cf5d06a9d329278b9d3950e06b6fc5e9c6b9 Mon Sep 17 00:00:00 2001 From: Xwite <82232510+Xwite@users.noreply.github.com> Date: Sat, 1 Oct 2022 08:54:13 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=96=87=E4=BB=B6=E7=B1=BB?= =?UTF-8?q?=E4=B9=A6=E6=BA=90=E6=8D=A2=E6=BA=90=E5=90=8E=E9=98=85=E8=AF=BB?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E5=B7=A5=E4=BD=9C=E4=B8=8D=E6=AD=A3=E7=A1=AE?= =?UTF-8?q?=E7=9A=84bug=20(#2352)?= 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 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 f915600b0..1b9addb4d 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 @@ -32,7 +32,8 @@ class BookInfoViewModel(application: Application) : BaseViewModel(application) { var inBookshelf = false var bookSource: BookSource? = null private var changeSourceCoroutine: Coroutine<*>? = null - var isImportBookOnLine = false + var isImportBookOnLine: Boolean + get() = (bookSource?.bookSourceType ?: BookType.local) == BookType.file fun initData(intent: Intent) { execute { @@ -76,7 +77,6 @@ class BookInfoViewModel(application: Application) : BaseViewModel(application) { upCoverByRule(book) bookSource = if (book.isLocalBook()) null else appDb.bookSourceDao.getBookSource(book.origin) - isImportBookOnLine = (bookSource?.bookSourceType ?: BookType.local) == BookType.file if (book.tocUrl.isEmpty()) { loadBookInfo(book) } else if (isImportBookOnLine) {