From 1c09bd527c8180425ddda378fef60b3ac2842788 Mon Sep 17 00:00:00 2001 From: Horis <821938089@qq.com> Date: Tue, 16 May 2023 21:56:04 +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/Debug.kt | 7 ++++--- .../main/java/io/legado/app/service/CheckSourceService.kt | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/io/legado/app/model/Debug.kt b/app/src/main/java/io/legado/app/model/Debug.kt index bfd4480b9..fa500d9be 100644 --- a/app/src/main/java/io/legado/app/model/Debug.kt +++ b/app/src/main/java/io/legado/app/model/Debug.kt @@ -255,11 +255,12 @@ object Debug { private fun tocDebug(scope: CoroutineScope, bookSource: BookSource, book: Book) { log(debugSource, "︾开始解析目录页") val chapterList = WebBook.getChapterList(scope, bookSource, book) - .onSuccess { + .onSuccess { chapters -> log(debugSource, "︽目录页解析完成") log(debugSource, showTime = false) - val nextChapterUrl = it.getOrNull(1)?.url ?: it.first().url - contentDebug(scope, bookSource, book, it.first(), nextChapterUrl) + val toc = chapters.filter { !(it.isVolume && it.url.startsWith(it.title)) } + val nextChapterUrl = toc.getOrNull(1)?.url ?: toc.first().url + contentDebug(scope, bookSource, book, toc.first(), nextChapterUrl) } .onError { log(debugSource, it.stackTraceStr, state = -1) 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 152e375e0..a2afe1683 100644 --- a/app/src/main/java/io/legado/app/service/CheckSourceService.kt +++ b/app/src/main/java/io/legado/app/service/CheckSourceService.kt @@ -213,6 +213,7 @@ class CheckSourceService : BaseService() { source.bookSourceType != BookSourceType.file ) { val toc = WebBook.getChapterListAwait(source, mBook).getOrThrow() + .filter { !(it.isVolume && it.url.startsWith(it.title)) } val nextChapterUrl = toc.getOrNull(1)?.url ?: toc.first().url //校验正文 if (CheckSource.checkContent) {