🐛 修复正则预览未读取自定义魔法匹配

This commit is contained in:
Cp0204 2025-04-20 21:25:45 +08:00
parent 668897d1df
commit 6079b95412
3 changed files with 5 additions and 3 deletions

View File

@ -282,6 +282,7 @@ def get_share_detail():
regex.get("pattern", ""),
regex.get("replace", ""),
regex.get("taskname", ""),
regex.get("magic_regex", {}),
)
for item in share_detail["list"]:
file_name = item["file_name"]

View File

@ -993,7 +993,8 @@
regex: {
pattern: this.formData.tasklist[this.fileSelect.index].pattern,
replace: this.formData.tasklist[this.fileSelect.index].replace,
taskname: this.formData.tasklist[this.fileSelect.index].taskname
taskname: this.formData.tasklist[this.fileSelect.index].taskname,
magic_regex: this.formData.magic_regex,
}
}).then(response => {
if (response.data.success) {

View File

@ -521,8 +521,8 @@ class Quark:
# ↓ 操作函数
# 魔法正则匹配
def magic_regex_func(self, pattern, replace, taskname=None):
magic_regex = CONFIG_DATA.get("magic_regex") or MAGIC_REGEX or {}
def magic_regex_func(self, pattern, replace, taskname=None, magic_regex={}):
magic_regex = magic_regex or CONFIG_DATA.get("magic_regex") or MAGIC_REGEX
keyword = pattern
if keyword in magic_regex:
pattern = magic_regex[keyword]["pattern"]