From c6d063301a80a00a9ae99e4a351ea3d94d447d03 Mon Sep 17 00:00:00 2001 From: gedoor Date: Mon, 19 Oct 2020 08:24:14 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=A2=84=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E4=BF=9D=E5=AD=98=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/assets/updateLog.md | 4 +++ .../io/legado/app/service/help/CacheBook.kt | 25 +++++++------------ 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/app/src/main/assets/updateLog.md b/app/src/main/assets/updateLog.md index ec5355f22..70e2b98ae 100644 --- a/app/src/main/assets/updateLog.md +++ b/app/src/main/assets/updateLog.md @@ -3,6 +3,10 @@ * 关注合作公众号 **[小说拾遗]()** 获取好看的小说。 * 旧版数据导入教程:先在旧版阅读(2.x)中进行备份,然后在新版阅读(3.x)【我的】->【备份与恢复】,选择【导入旧版本数据】。 +**2020/10/19** +* 优化分组管理 +* 修复预下载没有保存的bug + **2020/10/18** * 优化分组管理,默认分组可以重命名了 * 修复书架空白的bug,是constraintlayout库新版本的bug diff --git a/app/src/main/java/io/legado/app/service/help/CacheBook.kt b/app/src/main/java/io/legado/app/service/help/CacheBook.kt index 18b68b332..3e96bd616 100644 --- a/app/src/main/java/io/legado/app/service/help/CacheBook.kt +++ b/app/src/main/java/io/legado/app/service/help/CacheBook.kt @@ -77,23 +77,16 @@ object CacheBook { downloadMap[book.bookUrl]?.add(chapter.index) webBook.getContent(book, chapter) .onSuccess(IO) { content -> + if (content.isNotBlank()) { + BookHelp.saveContent(book, chapter, content) + } if (ReadBook.book?.bookUrl == book.bookUrl) { - if (content.isEmpty()) { - ReadBook.contentLoadFinish( - book, - chapter, - App.INSTANCE.getString(R.string.content_empty), - resetPageOffset = resetPageOffset - ) - } else { - BookHelp.saveContent(book, chapter, content) - ReadBook.contentLoadFinish( - book, - chapter, - content, - resetPageOffset = resetPageOffset - ) - } + ReadBook.contentLoadFinish( + book, + chapter, + content.ifBlank { App.INSTANCE.getString(R.string.content_empty) }, + resetPageOffset = resetPageOffset + ) } }.onError { if (ReadBook.book?.bookUrl == book.bookUrl) {