From 17e0544e07783e72851224d57392f2d45c1b4171 Mon Sep 17 00:00:00 2001 From: kunfei Date: Mon, 16 Jan 2023 10:17:23 +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 --- .../main/java/io/legado/app/data/entities/BaseSource.kt | 7 +++++++ .../io/legado/app/model/analyzeRule/RuleDataInterface.kt | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/io/legado/app/data/entities/BaseSource.kt b/app/src/main/java/io/legado/app/data/entities/BaseSource.kt index f9521c0d4..8ada19d69 100644 --- a/app/src/main/java/io/legado/app/data/entities/BaseSource.kt +++ b/app/src/main/java/io/legado/app/data/entities/BaseSource.kt @@ -179,6 +179,10 @@ interface BaseSource : JsExtensions { CacheManager.delete("userInfo_${getKey()}") } + /** + * 设置自定义变量 + * @param variable 变量内容 + */ fun setVariable(variable: String?) { if (variable != null) { CacheManager.put("sourceVariable_${getKey()}", variable) @@ -187,6 +191,9 @@ interface BaseSource : JsExtensions { } } + /** + * 获取自定义变量 + */ fun getVariable(): String? { return CacheManager.get("sourceVariable_${getKey()}") } diff --git a/app/src/main/java/io/legado/app/model/analyzeRule/RuleDataInterface.kt b/app/src/main/java/io/legado/app/model/analyzeRule/RuleDataInterface.kt index 7177f6a74..eaec99222 100644 --- a/app/src/main/java/io/legado/app/model/analyzeRule/RuleDataInterface.kt +++ b/app/src/main/java/io/legado/app/model/analyzeRule/RuleDataInterface.kt @@ -8,7 +8,7 @@ interface RuleDataInterface { return when { value == null -> { variableMap.remove(key) - putBigVariable(key, value) + putBigVariable(key, null) true } value.length < 10000 -> {