From d2a6a7beb620c83336dff61be80fefa53090ffc4 Mon Sep 17 00:00:00 2001 From: kunfei Date: Sat, 2 May 2020 10:36:00 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/assets/updateLog.md | 1 + .../main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/assets/updateLog.md b/app/src/main/assets/updateLog.md index 8155ed74e..54d4d2906 100644 --- a/app/src/main/assets/updateLog.md +++ b/app/src/main/assets/updateLog.md @@ -5,6 +5,7 @@ **2020/05/02** * 修复不停换源的bug +* 修复本地书籍自动换源 **2020/05/01** * 尝试修复朗读时可能错位的bug diff --git a/app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt b/app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt index d73ffd07a..a4755213d 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/ReadBookViewModel.kt @@ -41,7 +41,7 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) { private fun initBook(book: Book) { if (ReadBook.book?.bookUrl != book.bookUrl) { ReadBook.resetData(book) - if (ReadBook.webBook == null) { + if (!book.isLocalBook() && ReadBook.webBook == null) { autoChangeSource(book.name, book.author) return } @@ -66,7 +66,7 @@ class ReadBookViewModel(application: Application) : BaseViewModel(application) { isInitFinish = true ReadBook.titleDate.postValue(book.name) ReadBook.upWebBook(book) - if (ReadBook.webBook == null) { + if (!book.isLocalBook() && ReadBook.webBook == null) { autoChangeSource(book.name, book.author) return }