From 0cc3938c085037147d69cab0cd55d65131120d16 Mon Sep 17 00:00:00 2001 From: Xwite <1797350009@qq.com> Date: Mon, 7 Feb 2022 09:22:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=BF=E6=8D=A2=E5=87=80=E5=8C=96=E5=BA=94?= =?UTF-8?q?=E8=AF=A5=E5=9C=A8=E7=AE=80=E7=B9=81=E8=BD=AC=E6=8D=A2=E4=B9=8B?= =?UTF-8?q?=E5=90=8E=E8=BF=9B=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/legado/app/data/entities/BookChapter.kt | 12 ++++++------ .../main/java/io/legado/app/help/ContentProcessor.kt | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/src/main/java/io/legado/app/data/entities/BookChapter.kt b/app/src/main/java/io/legado/app/data/entities/BookChapter.kt index b6581689e..2f46bc002 100644 --- a/app/src/main/java/io/legado/app/data/entities/BookChapter.kt +++ b/app/src/main/java/io/legado/app/data/entities/BookChapter.kt @@ -81,6 +81,12 @@ data class BookChapter( ): String { var displayTitle = title.replace(AppPattern.rnRegex, "") val mDisplayTitle = displayTitle + if (chineseConvert) { + when (AppConfig.chineseConverterType) { + 1 -> displayTitle = ChineseUtils.t2s(displayTitle) + 2 -> displayTitle = ChineseUtils.s2t(displayTitle) + } + } if (useReplace && replaceRules != null) { replaceRules.forEach { item -> if (item.pattern.isNotEmpty()) { @@ -97,12 +103,6 @@ data class BookChapter( } } if (displayTitle.isBlank()) displayTitle = mDisplayTitle - if (chineseConvert) { - when (AppConfig.chineseConverterType) { - 1 -> displayTitle = ChineseUtils.t2s(displayTitle) - 2 -> displayTitle = ChineseUtils.s2t(displayTitle) - } - } return when { !isVip -> displayTitle isPay -> appCtx.getString(R.string.payed_title, displayTitle) diff --git a/app/src/main/java/io/legado/app/help/ContentProcessor.kt b/app/src/main/java/io/legado/app/help/ContentProcessor.kt index 800fde6a7..f8ed62e9a 100644 --- a/app/src/main/java/io/legado/app/help/ContentProcessor.kt +++ b/app/src/main/java/io/legado/app/help/ContentProcessor.kt @@ -77,10 +77,6 @@ class ContentProcessor private constructor( //重新分段 mContent = ContentHelp.reSegment(mContent, chapter.title) } - if (useReplace && book.getUseReplaceRule()) { - //替换 - mContent = replaceContent(mContent) - } if (chineseConvert) { //简繁转换 try { @@ -92,6 +88,10 @@ class ContentProcessor private constructor( appCtx.toastOnUi("简繁转换出错") } } + if (useReplace && book.getUseReplaceRule()) { + //替换 + mContent = replaceContent(mContent) + } if (includeTitle) { //重新添加标题 mContent = chapter.getDisplayTitle(getReplaceRules()) + "\n" + mContent