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] =?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("发现书籍为空") } } //校验详情