From 35f24dc89e05f1ce8419ea5611a3ce4b622d81ce Mon Sep 17 00:00:00 2001 From: gedoor Date: Sat, 8 Aug 2020 09:52:16 +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/java/io/legado/app/model/webBook/BookInfo.kt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/io/legado/app/model/webBook/BookInfo.kt b/app/src/main/java/io/legado/app/model/webBook/BookInfo.kt index 70c1a92be..ff50232e7 100644 --- a/app/src/main/java/io/legado/app/model/webBook/BookInfo.kt +++ b/app/src/main/java/io/legado/app/model/webBook/BookInfo.kt @@ -5,6 +5,7 @@ import io.legado.app.R import io.legado.app.constant.AppPattern import io.legado.app.data.entities.Book import io.legado.app.data.entities.BookSource +import io.legado.app.help.BookHelp import io.legado.app.model.Debug import io.legado.app.model.analyzeRule.AnalyzeRule import io.legado.app.utils.NetworkUtils @@ -33,12 +34,12 @@ object BookInfo { } } Debug.log(bookSource.bookSourceUrl, "┌获取书名") - analyzeRule.getString(infoRule.name).let { + analyzeRule.getString(infoRule.name).trim { it <= ' ' }.let { if (it.isNotEmpty()) book.name = it } Debug.log(bookSource.bookSourceUrl, "└${book.name}") Debug.log(bookSource.bookSourceUrl, "┌获取作者") - analyzeRule.getString(infoRule.author).let { + BookHelp.formatAuthor(analyzeRule.getString(infoRule.author)).let { if (it.isNotEmpty()) book.author = it.replace(AppPattern.authorRegex, "") } Debug.log(bookSource.bookSourceUrl, "└${book.author}")