From 34ad6007b219e38c2193a4e291aa395a528d40b9 Mon Sep 17 00:00:00 2001 From: Xwite <1797350009@qq.com> Date: Tue, 11 Jan 2022 15:22:15 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E4=BA=8C=E7=BA=A7=E7=9B=AE?= =?UTF-8?q?=E5=BD=95=E4=B9=A6=E6=BA=90=20=E6=AD=A3=E6=96=87=E4=B8=8D?= =?UTF-8?q?=E8=83=BD=E9=80=9A=E8=BF=87=E4=B9=A6=E6=BA=90=E6=A3=80=E6=B5=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/legado/app/model/webBook/BookChapterList.kt | 2 +- app/src/main/java/io/legado/app/model/webBook/WebBook.kt | 7 +++++-- .../app/ui/book/read/page/provider/ChapterProvider.kt | 4 ++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/io/legado/app/model/webBook/BookChapterList.kt b/app/src/main/java/io/legado/app/model/webBook/BookChapterList.kt index 2f250ca1e..72d13880d 100644 --- a/app/src/main/java/io/legado/app/model/webBook/BookChapterList.kt +++ b/app/src/main/java/io/legado/app/model/webBook/BookChapterList.kt @@ -194,7 +194,7 @@ object BookChapterList { if (bookChapter.url.isEmpty()) { if (bookChapter.isVolume) { bookChapter.url = bookChapter.title - Debug.log(bookSource.bookSourceUrl, "目录${index}(Volume)未获取到url,使用章节标题替代") + Debug.log(bookSource.bookSourceUrl, "一级目录${index}未获取到url,使用章节标题替代") } else { bookChapter.url = baseUrl Debug.log(bookSource.bookSourceUrl, "目录${index}未获取到url,使用baseUrl替代") diff --git a/app/src/main/java/io/legado/app/model/webBook/WebBook.kt b/app/src/main/java/io/legado/app/model/webBook/WebBook.kt index c95843c7f..8cb3d151a 100644 --- a/app/src/main/java/io/legado/app/model/webBook/WebBook.kt +++ b/app/src/main/java/io/legado/app/model/webBook/WebBook.kt @@ -261,8 +261,11 @@ object WebBook { Debug.log(bookSource.bookSourceUrl, "⇒正文规则为空,使用章节链接:${bookChapter.url}") return bookChapter.url } - //章节名为卷名时 且 章节url没获取到,返回空白 - if(bookChapter.isVolume && bookChapter.url == bookChapter.title) return "" + if(bookChapter.isVolume && bookChapter.url == bookChapter.title) { + //不返回空值,是为了过书源检测 + Debug.log(bookSource.bookSourceUrl, "⇒一级目录正文,使用章节标题:${bookChapter.title}") + return bookChapter.title + } return if (bookChapter.url == book.bookUrl && !book.tocHtml.isNullOrEmpty()) { BookContent.analyzeContent( scope = scope, diff --git a/app/src/main/java/io/legado/app/ui/book/read/page/provider/ChapterProvider.kt b/app/src/main/java/io/legado/app/ui/book/read/page/provider/ChapterProvider.kt index e9dadb9aa..9f7e3f3a8 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/page/provider/ChapterProvider.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/page/provider/ChapterProvider.kt @@ -332,7 +332,7 @@ object ChapterProvider { } lineIndex == layout.lineCount - 1 -> { //最后一行 - textLine.text = "$words\n" + textLine.text = if(isVolumeTitle) "" else "$words\n" isLastLine = true //标题居中 val startX = if (isTitle && ReadBookConfig.titleMode == 1 || isVolumeTitle) @@ -349,7 +349,7 @@ object ChapterProvider { } else -> { //中间行 - textLine.text = words + textLine.text = if(isVolumeTitle) "" else words addCharsToLineMiddle( absStartX, textLine,