From e13c948f099895c64440b05f2917aafa334a995a Mon Sep 17 00:00:00 2001 From: Xwite <1797350009@qq.com> Date: Tue, 11 Jan 2022 17:11:04 +0800 Subject: [PATCH 1/2] =?UTF-8?q?fix:=E5=8D=B7=E6=AD=A3=E6=96=87=E6=A0=87?= =?UTF-8?q?=E9=A2=98=E9=87=8D=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/legado/app/model/webBook/BookChapterList.kt | 2 +- app/src/main/java/io/legado/app/service/CheckSourceService.kt | 2 +- 2 files changed, 2 insertions(+), 2 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/service/CheckSourceService.kt b/app/src/main/java/io/legado/app/service/CheckSourceService.kt index 6887de070..f4f592ed7 100644 --- a/app/src/main/java/io/legado/app/service/CheckSourceService.kt +++ b/app/src/main/java/io/legado/app/service/CheckSourceService.kt @@ -144,7 +144,7 @@ class CheckSourceService : BaseService() { nextChapterUrl = nextChapterUrl, needSave = false ) - if (content.isBlank()) { + if ( !toc.first().isVolume && content.isBlank()) { throw NoStackTraceException("正文内容为空") } }.timeout(180000L) From 2973ce939792ea194bd1a5874f694c6e958e04c5 Mon Sep 17 00:00:00 2001 From: Xwite <1797350009@qq.com> Date: Tue, 11 Jan 2022 17:36:12 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=E5=8D=B7=E6=A0=87=E9=A2=98=E9=87=8D?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/src/main/java/io/legado/app/model/webBook/WebBook.kt | 5 ++--- .../legado/app/ui/book/read/page/provider/ChapterProvider.kt | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) 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 8cb3d151a..8435538dd 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 @@ -262,9 +262,8 @@ object WebBook { return bookChapter.url } if(bookChapter.isVolume && bookChapter.url == bookChapter.title) { - //不返回空值,是为了过书源检测 - Debug.log(bookSource.bookSourceUrl, "⇒一级目录正文,使用章节标题:${bookChapter.title}") - return bookChapter.title + Debug.log(bookSource.bookSourceUrl, "⇒一级目录获取链接为空,正文返回空白") + return "" } return if (bookChapter.url == book.bookUrl && !book.tocHtml.isNullOrEmpty()) { BookContent.analyzeContent( 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 9f7e3f3a8..e9dadb9aa 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 = if(isVolumeTitle) "" else "$words\n" + textLine.text = "$words\n" isLastLine = true //标题居中 val startX = if (isTitle && ReadBookConfig.titleMode == 1 || isVolumeTitle) @@ -349,7 +349,7 @@ object ChapterProvider { } else -> { //中间行 - textLine.text = if(isVolumeTitle) "" else words + textLine.text = words addCharsToLineMiddle( absStartX, textLine,