mirror of
https://github.com/Cp0204/quark-auto-save.git
synced 2026-01-12 07:10:44 +08:00
🐛 修复默认魔法匹配跳过重命名
This commit is contained in:
parent
d7d02471e7
commit
6174915041
@ -650,7 +650,8 @@ class Quark:
|
|||||||
return response
|
return response
|
||||||
|
|
||||||
def do_rename_task(self, task, subdir_path=""):
|
def do_rename_task(self, task, subdir_path=""):
|
||||||
if not task["pattern"] or not task["replace"]:
|
pattern, replace = magic_regex_func(task["pattern"], task["replace"])
|
||||||
|
if not pattern or not replace:
|
||||||
return 0
|
return 0
|
||||||
savepath = re.sub(r"/{2,}", "/", f"/{task['savepath']}{subdir_path}")
|
savepath = re.sub(r"/{2,}", "/", f"/{task['savepath']}{subdir_path}")
|
||||||
if not self.savepath_fid.get(savepath):
|
if not self.savepath_fid.get(savepath):
|
||||||
@ -663,7 +664,6 @@ class Quark:
|
|||||||
is_rename_count += self.do_rename_task(
|
is_rename_count += self.do_rename_task(
|
||||||
task, f"{subdir_path}/{dir_file['file_name']}"
|
task, f"{subdir_path}/{dir_file['file_name']}"
|
||||||
)
|
)
|
||||||
pattern, replace = magic_regex_func(task["pattern"], task["replace"])
|
|
||||||
if re.search(pattern, dir_file["file_name"]):
|
if re.search(pattern, dir_file["file_name"]):
|
||||||
save_name = (
|
save_name = (
|
||||||
re.sub(pattern, replace, dir_file["file_name"])
|
re.sub(pattern, replace, dir_file["file_name"])
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user