From 353746e02480fee5f68cb44df16ffc6f5fb815d1 Mon Sep 17 00:00:00 2001 From: gedoor Date: Sat, 25 Sep 2021 00:06:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/assets/updateLog.md | 4 ++++ app/src/main/java/io/legado/app/constant/AppPattern.kt | 1 + app/src/main/java/io/legado/app/data/entities/BookChapter.kt | 3 ++- .../main/java/io/legado/app/service/HttpReadAloudService.kt | 2 +- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/app/src/main/assets/updateLog.md b/app/src/main/assets/updateLog.md index e05888c12..cb92b19cd 100644 --- a/app/src/main/assets/updateLog.md +++ b/app/src/main/assets/updateLog.md @@ -12,6 +12,10 @@ * 漫画源看书显示乱码,**阅读与其他软件的源并不通用**,请导入阅读的支持的漫画源! * 关于最近版本有时候界面没有数据的问题是因为把LiveData组件换成了谷歌推荐的Flow组件导致的问题,正在查找解决办法 +**2021/09/25** + +1. 修复一些bug + **2021/09/22** 1. 修复在线朗读遇到单独......崩溃的问题 diff --git a/app/src/main/java/io/legado/app/constant/AppPattern.kt b/app/src/main/java/io/legado/app/constant/AppPattern.kt index 8e8a6f2db..fc3d127ea 100644 --- a/app/src/main/java/io/legado/app/constant/AppPattern.kt +++ b/app/src/main/java/io/legado/app/constant/AppPattern.kt @@ -17,4 +17,5 @@ object AppPattern { val splitGroupRegex = Regex("[,;,;]") val bdRegex = Regex("(\\p{P})+") + val rnRegex = Regex("[\\r\\n]") } 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 104b19085..39b8ea6b0 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 @@ -7,6 +7,7 @@ import androidx.room.Ignore import androidx.room.Index import com.github.liuyueyi.quick.transfer.ChineseUtils import io.legado.app.R +import io.legado.app.constant.AppPattern import io.legado.app.help.AppConfig import io.legado.app.model.analyzeRule.AnalyzeUrl import io.legado.app.model.analyzeRule.RuleDataInterface @@ -77,7 +78,7 @@ data class BookChapter( useReplace: Boolean = true, chineseConvert: Boolean = true, ): String { - var displayTitle = title + var displayTitle = title.replace(AppPattern.rnRegex, "") if (useReplace && replaceRules != null) { replaceRules.forEach { item -> if (item.pattern.isNotEmpty()) { diff --git a/app/src/main/java/io/legado/app/service/HttpReadAloudService.kt b/app/src/main/java/io/legado/app/service/HttpReadAloudService.kt index a7995e38c..237c6c6ec 100644 --- a/app/src/main/java/io/legado/app/service/HttpReadAloudService.kt +++ b/app/src/main/java/io/legado/app/service/HttpReadAloudService.kt @@ -269,7 +269,7 @@ class HttpReadAloudService : BaseReadAloudService(), } AppLog.addLog("朗读错误,($what, $extra)") errorNo++ - if (errorNo >= 3) { + if (errorNo >= 5) { toastOnUi("朗读连续3次错误, 最后一次错误代码($what, $extra)") ReadAloud.pause(this) } else {