From 9126dd88979bf56da630d1f375c92cafab249166 Mon Sep 17 00:00:00 2001 From: gedoor Date: Sat, 7 Nov 2020 15:09:51 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/io/legado/app/model/analyzeRule/AnalyzeRule.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt index 0d13ee94d..642fe693f 100644 --- a/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt +++ b/app/src/main/java/io/legado/app/model/analyzeRule/AnalyzeRule.kt @@ -39,10 +39,11 @@ class AnalyzeRule(var book: BaseBook? = null) : JsExtensions { private var objectChangedJP = false @Throws(Exception::class) - fun setContent(content: Any?): AnalyzeRule { + fun setContent(content: Any?, baseUrl: String? = null): AnalyzeRule { if (content == null) throw AssertionError("Content cannot be null") - isJSON = content.toString().isJson() this.content = content + setBaseUrl(baseUrl) + isJSON = content.toString().isJson() objectChangedXP = true objectChangedJS = true objectChangedJP = true @@ -50,8 +51,8 @@ class AnalyzeRule(var book: BaseBook? = null) : JsExtensions { } fun setBaseUrl(baseUrl: String?): AnalyzeRule { - this.baseUrl = baseUrl baseUrl?.let { + this.baseUrl = baseUrl try { baseURL = URL(baseUrl.substringBefore(",")) } catch (e: Exception) {