去除doc,功能重复

pull/473/head
gedoor 4 years ago
parent 3b2aa50246
commit 07f373a03c
  1. 8
      app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt

@ -23,8 +23,6 @@ import kotlin.collections.HashMap
@Suppress("unused", "RegExpRedundantEscape") @Suppress("unused", "RegExpRedundantEscape")
class AnalyzeRule(var book: BaseBook? = null) : JsExtensions { class AnalyzeRule(var book: BaseBook? = null) : JsExtensions {
var chapter: BookChapter? = null var chapter: BookChapter? = null
var doc: Any? = null
private set
private var content: Any? = null private var content: Any? = null
private var baseUrl: String? = null private var baseUrl: String? = null
private var baseURL: URL? = null private var baseURL: URL? = null
@ -44,11 +42,6 @@ class AnalyzeRule(var book: BaseBook? = null) : JsExtensions {
this.content = content this.content = content
setBaseUrl(baseUrl) setBaseUrl(baseUrl)
isJSON = content.toString().isJson() isJSON = content.toString().isJson()
doc = if (isJSON) {
AnalyzeByJSonPath.parse(content)
} else {
AnalyzeByJSoup.parse(content)
}
objectChangedXP = true objectChangedXP = true
objectChangedJS = true objectChangedJS = true
objectChangedJP = true objectChangedJP = true
@ -628,7 +621,6 @@ class AnalyzeRule(var book: BaseBook? = null) : JsExtensions {
private fun evalJS(jsStr: String, result: Any?): Any? { private fun evalJS(jsStr: String, result: Any?): Any? {
val bindings = SimpleBindings() val bindings = SimpleBindings()
bindings["java"] = this bindings["java"] = this
bindings["doc"] = doc
bindings["book"] = book bindings["book"] = book
bindings["result"] = result bindings["result"] = result
bindings["baseUrl"] = baseUrl bindings["baseUrl"] = baseUrl

Loading…
Cancel
Save