add more effects

This commit is contained in:
bridge
2025-10-16 02:09:53 +08:00
parent 14317a7b78
commit 7ebf266e9e
2 changed files with 13 additions and 5 deletions

View File

@@ -20,6 +20,14 @@ def load_effect_from_str(value: object) -> dict[str, Any]:
s = str(value).strip()
if not s or s == "nan":
return {}
# 使用全局配置中的分隔符将占位分隔符替换回逗号,便于 JSON/字面量解析
try:
from src.utils.config import CONFIG # 延迟导入避免循环依赖
sep = str(getattr(getattr(CONFIG, "df", {}), "ids_separator", ","))
if sep and sep != ",":
s = s.replace(sep, ",")
except Exception:
pass
try:
obj = json.loads(s)
return obj if isinstance(obj, dict) else {}