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