From da53666811096145cbd530409a099d9a5ade235c Mon Sep 17 00:00:00 2001 From: Xwite <1797350009@qq.com> Date: Tue, 25 Jan 2022 09:03:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A0=A1=E9=AA=8C=E6=8F=90=E7=A4=BA=E4=BC=98?= =?UTF-8?q?=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 | 4 ++-- .../java/io/legado/app/model/webBook/BookChapterList.kt | 4 ++-- .../main/java/io/legado/app/service/CheckSourceService.kt | 6 +++++- 3 files changed, 9 insertions(+), 5 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 31bef2c81..445affb7f 100644 --- a/app/src/main/java/io/legado/app/model/Debug.kt +++ b/app/src/main/java/io/legado/app/model/Debug.kt @@ -56,8 +56,8 @@ object Debug { if (showTime && debugTimeMap[sourceUrl] != null) { val time = debugTimeFormat.format(Date(System.currentTimeMillis() - debugTimeMap[sourceUrl]!!)) - printMsg = "$time $printMsg" - debugMessageMap[sourceUrl] = printMsg + printMsg = printMsg.substring(1) + debugMessageMap[sourceUrl] = "$time $printMsg" } } } 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 faf5f1fa4..d76395e20 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,10 +194,10 @@ object BookChapterList { if (bookChapter.url.isEmpty()) { if (bookChapter.isVolume) { bookChapter.url = bookChapter.title + index - Debug.log(bookSource.bookSourceUrl, "一级目录${index}未获取到url,使用${bookChapter.title}${index}替代") + Debug.log(bookSource.bookSourceUrl, "⇒一级目录${index}未获取到url,使用标题替代") } else { bookChapter.url = baseUrl - Debug.log(bookSource.bookSourceUrl, "目录${index}未获取到url,使用baseUrl替代") + Debug.log(bookSource.bookSourceUrl, "⇒目录${index}未获取到url,使用baseUrl替代") } } if (bookChapter.title.isNotEmpty()) { 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 bce12d231..7ae8268d5 100644 --- a/app/src/main/java/io/legado/app/service/CheckSourceService.kt +++ b/app/src/main/java/io/legado/app/service/CheckSourceService.kt @@ -133,8 +133,12 @@ class CheckSourceService : BaseService() { throw NoStackTraceException("搜索内容为空并且没有发现") } books = WebBook.exploreBookAwait(this, source, url) + if (books.isEmpty()) { + throw NoStackTraceException("发现书籍为空") + } + } else { + source.removeGroup("搜索失效") } - source.removeGroup("搜索失效") var book = books.first().toBook() if (book.tocUrl.isBlank()) { book = WebBook.getBookInfoAwait(this, source, book)