From e13a966821a48e16f5e9809f8729ca61d8ca00ab Mon Sep 17 00:00:00 2001 From: Xwite <1797350009@qq.com> Date: Sun, 26 Mar 2023 19:33:56 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AF=BC=E5=87=BAtxt=E6=97=B6=E4=B8=8D?= =?UTF-8?q?=E4=BF=9D=E7=95=99vip=E6=A0=87=E8=AF=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/assets/updateLog.md | 1 + .../io/legado/app/ui/book/cache/CacheViewModel.kt | 13 +++++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/app/src/main/assets/updateLog.md b/app/src/main/assets/updateLog.md index dfa709e45..1df4a8892 100644 --- a/app/src/main/assets/updateLog.md +++ b/app/src/main/assets/updateLog.md @@ -17,6 +17,7 @@ * 更新rhino: 1.7.14-2 * 修复bug * 详情页下拉刷新 +* 导出为本地文件时不保留vip标识 * 其中一些更新由 Xwite, Horis提供 **2023/03/21** diff --git a/app/src/main/java/io/legado/app/ui/book/cache/CacheViewModel.kt b/app/src/main/java/io/legado/app/ui/book/cache/CacheViewModel.kt index b774a23ef..a8aae2555 100644 --- a/app/src/main/java/io/legado/app/ui/book/cache/CacheViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/book/cache/CacheViewModel.kt @@ -222,6 +222,7 @@ class CacheViewModel(application: Application) : BaseViewModel(application) { val content1 = contentProcessor .getContent( book, + // 不导出vip标识 chapter.apply { isVip = false }, content ?: if (chapter.isVolume) "" else "null", includeTitle = !AppConfig.exportNoChapterName, @@ -511,10 +512,14 @@ class CacheViewModel(application: Application) : BaseViewModel(application) { chineseConvert = false, reSegment = false ).toString() - val title = chapter.getDisplayTitle( - contentProcessor.getTitleReplaceRules(), - useReplace = useReplace - ) + val title = chapter.run { + // 不导出vip标识 + isVip = false + getDisplayTitle( + contentProcessor.getTitleReplaceRules(), + useReplace = useReplace + ) + } epubBook.addSection( title, ResourceUtil.createChapterResource(