Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -142,11 +142,14 @@ data class BookSource(
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun removeInvalidGroups() {
|
||||||
|
removeGroup(getInvalidGroupNames())
|
||||||
|
}
|
||||||
|
|
||||||
fun getInvalidGroupNames(): String? {
|
fun getInvalidGroupNames(): String {
|
||||||
return bookSourceGroup?.splitNotBlank(AppPattern.splitGroupRegex)?.toHashSet()?.filter {
|
return bookSourceGroup?.splitNotBlank(AppPattern.splitGroupRegex)?.toHashSet()?.filter {
|
||||||
"失效" in it
|
"失效" in it
|
||||||
}?.joinToString()
|
}?.joinToString() ?: ""
|
||||||
}
|
}
|
||||||
|
|
||||||
fun equal(source: BookSource) =
|
fun equal(source: BookSource) =
|
||||||
|
|||||||
@@ -124,6 +124,7 @@ class CheckSourceService : BaseService() {
|
|||||||
searchWord = it
|
searchWord = it
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
source.removeInvalidGroups()
|
||||||
source.bookSourceComment = source.bookSourceComment
|
source.bookSourceComment = source.bookSourceComment
|
||||||
?.split("\n\n")
|
?.split("\n\n")
|
||||||
?.filterNot {
|
?.filterNot {
|
||||||
@@ -172,7 +173,7 @@ class CheckSourceService : BaseService() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
val finalCheckMessage = source.getInvalidGroupNames()
|
val finalCheckMessage = source.getInvalidGroupNames()
|
||||||
if (!finalCheckMessage.isNullOrBlank()) throw NoStackTraceException(finalCheckMessage)
|
if (finalCheckMessage.isNotBlank()) throw NoStackTraceException(finalCheckMessage)
|
||||||
}.timeout(CheckSource.timeout)
|
}.timeout(CheckSource.timeout)
|
||||||
.onError(searchCoroutine) {
|
.onError(searchCoroutine) {
|
||||||
when(it) {
|
when(it) {
|
||||||
@@ -230,7 +231,7 @@ class CheckSourceService : BaseService() {
|
|||||||
when (it) {
|
when (it) {
|
||||||
is ContentEmptyException -> source.addGroup("${bookType}正文失效")
|
is ContentEmptyException -> source.addGroup("${bookType}正文失效")
|
||||||
is TocEmptyException -> source.addGroup("${bookType}目录失效")
|
is TocEmptyException -> source.addGroup("${bookType}目录失效")
|
||||||
//超时??js错误
|
//超时 网站异常 源码改变
|
||||||
else -> throw it
|
else -> throw it
|
||||||
}
|
}
|
||||||
}.onSuccess {
|
}.onSuccess {
|
||||||
|
|||||||
Reference in New Issue
Block a user