From a66bf6f436765f12f44d24267980407769bba69e Mon Sep 17 00:00:00 2001 From: Xwite <1797350009@qq.com> Date: Wed, 2 Feb 2022 21:29:52 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=B9=A6=E6=BA=90=E6=A0=A1=E9=AA=8C:?= =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/io/legado/app/service/CheckSourceService.kt | 8 ++++++-- 1 file changed, 6 insertions(+), 2 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 2cf89b6e4..d19e86b1a 100644 --- a/app/src/main/java/io/legado/app/service/CheckSourceService.kt +++ b/app/src/main/java/io/legado/app/service/CheckSourceService.kt @@ -143,8 +143,12 @@ class CheckSourceService : BaseService() { break } } - if (source.hasGroup("搜索失效") && url.isNullOrBlank()) { - throw NoStackTraceException("搜索内容为空并且没有发现") + if (url.isNullOrBlank()) { + if (source.hasGroup("搜索失效")) { + throw NoStackTraceException("搜索内容为空并且没有发现") + } else { + throw NoStackTraceException("没有发现") + } } books = WebBook.exploreBookAwait(this, source, url) if (books.isEmpty()) { From c3c8649010341df40e73ab1019d218313f275594 Mon Sep 17 00:00:00 2001 From: Xwite <1797350009@qq.com> Date: Wed, 2 Feb 2022 22:13:52 +0800 Subject: [PATCH 2/2] =?UTF-8?q?fix:=E5=90=8C=E6=97=B6=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E5=8F=91=E7=8E=B0=E6=97=B6=EF=BC=8C=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E6=AD=A3=E5=B8=B8=E5=8F=91=E7=8E=B0=E4=B8=BA=E7=A9=BA?= =?UTF-8?q?=E6=97=B6=20=E6=A0=A1=E9=AA=8C=E5=81=9C=E6=AD=A2=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../legado/app/service/CheckSourceService.kt | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 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 d19e86b1a..45ddc5933 100644 --- a/app/src/main/java/io/legado/app/service/CheckSourceService.kt +++ b/app/src/main/java/io/legado/app/service/CheckSourceService.kt @@ -144,15 +144,18 @@ class CheckSourceService : BaseService() { } } if (url.isNullOrBlank()) { - if (source.hasGroup("搜索失效")) { - throw NoStackTraceException("搜索内容为空并且没有发现") - } else { - throw NoStackTraceException("没有发现") + when { + !CheckSource.checkSearch -> throw NoStackTraceException("没有发现") + source.hasGroup("搜索失效") -> throw NoStackTraceException("搜索内容为空并且没有发现") + } + } else { + books = WebBook.exploreBookAwait(this, source, url) + if (books.isEmpty()) { + when { + !CheckSource.checkSearch -> throw NoStackTraceException("发现书籍为空") + source.hasGroup("搜索失效") -> throw NoStackTraceException("搜索内容和发现书籍为空") + } } - } - books = WebBook.exploreBookAwait(this, source, url) - if (books.isEmpty()) { - throw NoStackTraceException("发现书籍为空") } } //校验详情