pull/48/head
kunfei 5 years ago
parent 65b2abe60d
commit 0b0c8a461d
  1. 2
      app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt

@ -190,6 +190,7 @@ class AnalyzeRule(var book: BaseBook? = null) {
putRule(sourceRule.putMap) putRule(sourceRule.putMap)
sourceRule.makeUpRule(result) sourceRule.makeUpRule(result)
result?.let { result?.let {
if (sourceRule.rule.isNotBlank() || sourceRule.replaceRegex.isEmpty()) {
result = when (sourceRule.mode) { result = when (sourceRule.mode) {
Mode.Js -> evalJS(sourceRule.rule, it) Mode.Js -> evalJS(sourceRule.rule, it)
Mode.Json -> getAnalyzeByJSonPath(it).getString(sourceRule.rule) Mode.Json -> getAnalyzeByJSonPath(it).getString(sourceRule.rule)
@ -201,6 +202,7 @@ class AnalyzeRule(var book: BaseBook? = null) {
} }
else -> sourceRule.rule else -> sourceRule.rule
} }
}
if (sourceRule.replaceRegex.isNotEmpty()) { if (sourceRule.replaceRegex.isNotEmpty()) {
result = replaceRegex(result.toString(), sourceRule) result = replaceRegex(result.toString(), sourceRule)
} }

Loading…
Cancel
Save