diff --git a/app/src/main/assets/help/SourceMBookHelp.md b/app/src/main/assets/help/SourceMBookHelp.md index 9561ed69f..3f931e0c3 100644 --- a/app/src/main/assets/help/SourceMBookHelp.md +++ b/app/src/main/assets/help/SourceMBookHelp.md @@ -22,4 +22,8 @@ * 置底所选 * 导出所选 * 校验所选 -* "校验成功"是指所选的校验项目全部通过,"失败:发现为空"不视为"失效",校验结束后会自动筛选"失效"书源 \ No newline at end of file +* 校验书源可批量校验书源,由于网络等原因结果仅限参考 + * "校验成功"是指所选的校验项目全部通过 + * 可正常识别搜索为空、发现为空、目录为空、正文为空、校验超时导致的失效,其余原因导致的视为规则失效 + * 校验搜索优先使用书源填写的校验关键词,不存在时使用用户输入的关键词 + * 校验结束后会自动筛选"失效"书源 \ No newline at end of file diff --git a/app/src/main/assets/updateLog.md b/app/src/main/assets/updateLog.md index 3ada71306..835e67ce5 100644 --- a/app/src/main/assets/updateLog.md +++ b/app/src/main/assets/updateLog.md @@ -15,6 +15,7 @@ * 可以单独给书籍设置朗读tts * 目录界面菜单添加替换开关,开启替换加载时间会长一些 +* 书源校验添加规则失效分组,更新书源界面帮助文档 **2022/02/09** 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 bded2777d..223e235a8 100644 --- a/app/src/main/java/io/legado/app/service/CheckSourceService.kt +++ b/app/src/main/java/io/legado/app/service/CheckSourceService.kt @@ -20,6 +20,7 @@ import io.legado.app.utils.postEvent import io.legado.app.utils.servicePendingIntent import io.legado.app.utils.toastOnUi import kotlinx.coroutines.Dispatchers.IO +import kotlinx.coroutines.TimeoutCancellationException import kotlinx.coroutines.asCoroutineDispatcher import java.util.concurrent.Executors import kotlin.math.min @@ -199,6 +200,10 @@ class CheckSourceService : BaseService() { when(it) { is ContentEmptyException -> source.addGroup("正文失效") is TocEmptyException -> source.addGroup("目录失效") + //校验超时不能正常实现 不能识别 + is TimeoutCancellationException -> source.addGroup("校验超时") + //NoStackTraceException 已经添加了分组,其余的视为规则失效 + !is NoStackTraceException -> source.addGroup("规则失效") } source.bookSourceComment = "Error: ${it.localizedMessage}" + if (source.bookSourceComment.isNullOrBlank()) @@ -206,6 +211,8 @@ class CheckSourceService : BaseService() { Debug.updateFinalMessage(source.bookSourceUrl, "校验失败:${it.localizedMessage}") }.onSuccess(searchCoroutine) { source.removeGroup("失效") + source.removeGroup("规则失效") + source.removeGroup("校验超时") Debug.updateFinalMessage(source.bookSourceUrl, "校验成功") }.onFinally(IO) { source.respondTime = Debug.getRespondTime(source.bookSourceUrl)