From d7d8845e98594aed143dc0566aae2de8c8a2c903 Mon Sep 17 00:00:00 2001 From: Xwite <1797350009@qq.com> Date: Fri, 13 May 2022 12:14:30 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=AF=BC=E5=85=A5=E5=9C=A8=E7=BA=BF?= =?UTF-8?q?=E6=96=87=E4=BB=B6bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/legado/app/ui/book/info/BookInfoActivity.kt | 2 +- .../main/java/io/legado/app/ui/book/info/BookInfoViewModel.kt | 4 +++- app/src/main/res/values-es-rES/strings.xml | 1 + app/src/main/res/values-ja-rJP/strings.xml | 1 + app/src/main/res/values-pt-rBR/strings.xml | 1 + app/src/main/res/values-zh-rHK/strings.xml | 1 + app/src/main/res/values-zh-rTW/strings.xml | 1 + app/src/main/res/values-zh/strings.xml | 1 + app/src/main/res/values/strings.xml | 1 + 9 files changed, 11 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt b/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt index d21ecfa05..dfad88975 100644 --- a/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt @@ -230,7 +230,7 @@ class BookInfoActivity : binding.tvToc.text = getString(R.string.toc_s, getString(R.string.loading)) } chapterList.isNullOrEmpty() -> { - binding.tvToc.text = getString(R.string.toc_s, getString(R.string.error_load_toc)) + binding.tvToc.text = if (viewModel.isImportBookOnLine) getString(R.string.click_read_button_load) else getString(R.string.toc_s, getString(R.string.error_load_toc)) } else -> { viewModel.bookData.value?.let { 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 59eda63f0..a76e97a97 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 @@ -111,7 +111,7 @@ class BookInfoViewModel(application: Application) : BaseViewModel(application) { execute(scope) { if (book.isLocalBook()) { loadChapter(book, scope) - } else if (!isImportBookOnLine) { + } else { bookSource?.let { bookSource -> WebBook.getBookInfo(this, bookSource, book, canReName = canReName) .onSuccess(IO) { @@ -144,6 +144,8 @@ class BookInfoViewModel(application: Application) : BaseViewModel(application) { appDb.bookChapterDao.insert(*it.toTypedArray()) chapterListData.postValue(it) } + } else if(!isImportBookOnLine) { + chapterListData.postValue(emptyList()) } else { bookSource?.let { bookSource -> WebBook.getChapterList(this, bookSource, book) diff --git a/app/src/main/res/values-es-rES/strings.xml b/app/src/main/res/values-es-rES/strings.xml index a3a5e4521..7e6011d0b 100644 --- a/app/src/main/res/values-es-rES/strings.xml +++ b/app/src/main/res/values-es-rES/strings.xml @@ -979,5 +979,6 @@ 导入主题 导入txt目录规则 CookieJar + 点击阅读加载目录 diff --git a/app/src/main/res/values-ja-rJP/strings.xml b/app/src/main/res/values-ja-rJP/strings.xml index e98d5fa0b..06cff97fc 100644 --- a/app/src/main/res/values-ja-rJP/strings.xml +++ b/app/src/main/res/values-ja-rJP/strings.xml @@ -982,5 +982,6 @@ 导入主题 导入txt目录规则 CookieJar + 点击阅读加载目录 diff --git a/app/src/main/res/values-pt-rBR/strings.xml b/app/src/main/res/values-pt-rBR/strings.xml index 7646b005e..09cc15699 100644 --- a/app/src/main/res/values-pt-rBR/strings.xml +++ b/app/src/main/res/values-pt-rBR/strings.xml @@ -982,5 +982,6 @@ 导入主题 导入txt目录规则 CookieJar + 点击阅读加载目录 diff --git a/app/src/main/res/values-zh-rHK/strings.xml b/app/src/main/res/values-zh-rHK/strings.xml index 90eb8bc6d..eb359a20f 100644 --- a/app/src/main/res/values-zh-rHK/strings.xml +++ b/app/src/main/res/values-zh-rHK/strings.xml @@ -979,5 +979,6 @@ 导入主题 导入txt目录规则 CookieJar + 点击阅读加载目录 diff --git a/app/src/main/res/values-zh-rTW/strings.xml b/app/src/main/res/values-zh-rTW/strings.xml index 0de83ac2f..8ae5eaca7 100644 --- a/app/src/main/res/values-zh-rTW/strings.xml +++ b/app/src/main/res/values-zh-rTW/strings.xml @@ -981,5 +981,6 @@ 导入主题 导入txt目录规则 CookieJar + 点击阅读加载目录 diff --git a/app/src/main/res/values-zh/strings.xml b/app/src/main/res/values-zh/strings.xml index 19069a3f2..a9a530cc1 100644 --- a/app/src/main/res/values-zh/strings.xml +++ b/app/src/main/res/values-zh/strings.xml @@ -981,5 +981,6 @@ 导入主题 导入txt目录规则 CookieJar + 点击阅读加载目录 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 582890f12..3243f3d87 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -982,5 +982,6 @@ 导入主题 导入txt目录规则 CookieJar + 点击阅读加载目录