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) {