fix: 导入在线文件bug

pull/1879/head
Xwite 3 years ago
parent a5f4ff16bc
commit d7d8845e98
  1. 2
      app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt
  2. 4
      app/src/main/java/io/legado/app/ui/book/info/BookInfoViewModel.kt
  3. 1
      app/src/main/res/values-es-rES/strings.xml
  4. 1
      app/src/main/res/values-ja-rJP/strings.xml
  5. 1
      app/src/main/res/values-pt-rBR/strings.xml
  6. 1
      app/src/main/res/values-zh-rHK/strings.xml
  7. 1
      app/src/main/res/values-zh-rTW/strings.xml
  8. 1
      app/src/main/res/values-zh/strings.xml
  9. 1
      app/src/main/res/values/strings.xml

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

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

@ -979,5 +979,6 @@
<string name="import_theme">导入主题</string>
<string name="import_txt_toc_rule">导入txt目录规则</string>
<string name="auto_save_cookie">CookieJar</string>
<string name="click_read_button_load">点击阅读加载目录</string>
<!-- string end -->
</resources>

@ -982,5 +982,6 @@
<string name="import_theme">导入主题</string>
<string name="import_txt_toc_rule">导入txt目录规则</string>
<string name="auto_save_cookie">CookieJar</string>
<string name="click_read_button_load">点击阅读加载目录</string>
<!-- string end -->
</resources>

@ -982,5 +982,6 @@
<string name="import_theme">导入主题</string>
<string name="import_txt_toc_rule">导入txt目录规则</string>
<string name="auto_save_cookie">CookieJar</string>
<string name="click_read_button_load">点击阅读加载目录</string>
<!-- string end -->
</resources>

@ -979,5 +979,6 @@
<string name="import_theme">导入主题</string>
<string name="import_txt_toc_rule">导入txt目录规则</string>
<string name="auto_save_cookie">CookieJar</string>
<string name="click_read_button_load">点击阅读加载目录</string>
<!-- string end -->
</resources>

@ -981,5 +981,6 @@
<string name="import_theme">导入主题</string>
<string name="import_txt_toc_rule">导入txt目录规则</string>
<string name="auto_save_cookie">CookieJar</string>
<string name="click_read_button_load">点击阅读加载目录</string>
<!-- string end -->
</resources>

@ -981,5 +981,6 @@
<string name="import_theme">导入主题</string>
<string name="import_txt_toc_rule">导入txt目录规则</string>
<string name="auto_save_cookie">CookieJar</string>
<string name="click_read_button_load">点击阅读加载目录</string>
<!-- string end -->
</resources>

@ -982,5 +982,6 @@
<string name="import_theme">导入主题</string>
<string name="import_txt_toc_rule">导入txt目录规则</string>
<string name="auto_save_cookie">CookieJar</string>
<string name="click_read_button_load">点击阅读加载目录</string>
<!-- string end -->
</resources>

Loading…
Cancel
Save