mirror of
https://github.com/gedoor/legado.git
synced 2025-08-10 00:52:30 +00:00
优化
This commit is contained in:
@@ -27,8 +27,8 @@ interface BaseBook : RuleDataInterface {
|
||||
putVariable("custom", value)
|
||||
}
|
||||
|
||||
fun getCustomVariable(): String? {
|
||||
return getVariable("custom")
|
||||
fun getCustomVariable(): String {
|
||||
return getVariable("custom") ?: ""
|
||||
}
|
||||
|
||||
override fun putBigVariable(key: String, value: String?) {
|
||||
|
||||
@@ -196,8 +196,8 @@ interface BaseSource : JsExtensions {
|
||||
/**
|
||||
* 获取自定义变量
|
||||
*/
|
||||
fun getVariable(): String? {
|
||||
return CacheManager.get("sourceVariable_${getKey()}")
|
||||
fun getVariable(): String {
|
||||
return CacheManager.get("sourceVariable_${getKey()}") ?: ""
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -24,8 +24,8 @@ interface RuleDataInterface {
|
||||
|
||||
fun putBigVariable(key: String, value: String?)
|
||||
|
||||
fun getVariable(key: String): String? {
|
||||
return variableMap[key] ?: getBigVariable(key)
|
||||
fun getVariable(key: String): String {
|
||||
return variableMap[key] ?: getBigVariable(key) ?: ""
|
||||
}
|
||||
|
||||
fun getBigVariable(key: String): String?
|
||||
|
||||
Reference in New Issue
Block a user