From 38185f07fbe31a8ca266d18a0e07f0953d9fc9c2 Mon Sep 17 00:00:00 2001 From: Xwite <1797350009@qq.com> Date: Wed, 2 Feb 2022 21:03:30 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=B9=A6=E6=BA=90=E6=A0=A1=E9=AA=8C:?= =?UTF-8?q?=E5=8F=AA=E6=A0=A1=E9=AA=8C=E6=90=9C=E7=B4=A2=E6=97=B6=20?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E7=BB=93=E6=9E=9C=E4=B8=BA=E7=A9=BA=E5=BA=94?= =?UTF-8?q?=E8=AF=A5=E6=8A=9B=E5=87=BA=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/legado/app/service/CheckSourceService.kt | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 a7c057b43..06735cb28 100644 --- a/app/src/main/java/io/legado/app/service/CheckSourceService.kt +++ b/app/src/main/java/io/legado/app/service/CheckSourceService.kt @@ -124,7 +124,14 @@ class CheckSourceService : BaseService() { //校验搜索 用户设置校验搜索 并且 搜索链接不为空 if (CheckSource.checkSearch && !source.searchUrl.isNullOrBlank()) { books = WebBook.searchBookAwait(this, source, searchWord) - if (books.isEmpty()) source.addGroup("搜索失效") else source.removeGroup("搜索失效") + if (books.isEmpty()) { + source.addGroup("搜索失效") + if (!CheckSource.checkDiscovery) { + throw NoStackTraceException("搜索书籍为空") + } + } else { + source.removeGroup("搜索失效") + } } //校验发现 if (CheckSource.checkDiscovery) { From eee0cf1f1b3e4d6b92e44f117749b8bff6f96b89 Mon Sep 17 00:00:00 2001 From: Xwite <1797350009@qq.com> Date: Wed, 2 Feb 2022 21:18:56 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=B9=A6=E6=BA=90=E6=A0=A1=E9=AA=8C:?= =?UTF-8?q?=E5=90=8C=E6=97=B6=E6=A0=A1=E9=AA=8C=E6=90=9C=E7=B4=A2=E5=92=8C?= =?UTF-8?q?=E5=8F=91=E7=8E=B0=E6=97=B6=20=E6=90=9C=E7=B4=A2=E7=BB=93?= =?UTF-8?q?=E6=9E=9C=E4=B8=8D=E4=B8=BA=E7=A9=BA=E6=97=B6=E8=B7=B3=E8=BF=87?= =?UTF-8?q?=E6=A0=A1=E9=AA=8C=E5=8F=91=E7=8E=B0=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../legado/app/service/CheckSourceService.kt | 28 +++++++++---------- 1 file changed, 13 insertions(+), 15 deletions(-) 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 06735cb28..2cf89b6e4 100644 --- a/app/src/main/java/io/legado/app/service/CheckSourceService.kt +++ b/app/src/main/java/io/legado/app/service/CheckSourceService.kt @@ -135,23 +135,21 @@ class CheckSourceService : BaseService() { } //校验发现 if (CheckSource.checkDiscovery) { - if (books.isEmpty()) { - val exs = source.exploreKinds - var url: String? = null - for (ex in exs) { - url = ex.url - if (!url.isNullOrBlank()) { - break - } - } - if (url.isNullOrBlank()) { - throw NoStackTraceException("搜索内容为空并且没有发现") - } - books = WebBook.exploreBookAwait(this, source, url) - if (books.isEmpty()) { - throw NoStackTraceException("发现书籍为空") + val exs = source.exploreKinds + var url: String? = null + for (ex in exs) { + url = ex.url + if (!url.isNullOrBlank()) { + break } } + if (source.hasGroup("搜索失效") && url.isNullOrBlank()) { + throw NoStackTraceException("搜索内容为空并且没有发现") + } + books = WebBook.exploreBookAwait(this, source, url) + if (books.isEmpty()) { + throw NoStackTraceException("发现书籍为空") + } } //校验详情 if (CheckSource.checkInfo) {