Compare commits

..

1 Commits

Author SHA1 Message Date
jenfonro
f5937002c8
Merge 07df5b6f3d into f6b7ecdc83 2025-06-26 17:28:24 +08:00
2 changed files with 8 additions and 13 deletions

View File

@ -164,9 +164,7 @@ class Alist_sync:
# 获取网盘已有文件
source_dir_list = self.get_path_list(self.source_path)
if not source_dir_list:
print("获取夸克文件列表失败请检查网络或手动刷新alist中的夸克目录")
return 0
if self.tv_mode == 0 or self.tv_mode == "":
self.tv_mode = False
else:
@ -230,11 +228,11 @@ class Alist_sync:
.lower()
)
for target_list in target_dir_list:
if source_list["is_dir"]:
# print(f"跳过目录同步")
skip = True
break
if self.tv_mode:
if source_list["is_dir"]:
# print(f"跳过目录同步")
skip = True
break
target_list_filename = (
target_list["name"]
.replace(".mp4", "")

View File

@ -195,9 +195,6 @@ class MagicRename:
"",
"",
"",
"",
"",
"",
]
def __init__(self, magic_regex={}, magic_variable={}):
@ -262,14 +259,14 @@ class MagicRename:
"""自定义排序键"""
for i, keyword in enumerate(self.priority_list):
if keyword in name:
name = name.replace(keyword, f"_{i:02d}_") # 替换为数字,方便排序
return name.replace(keyword, f"{i:02d}") # 替换为数字,方便排序
return name
def sort_file_list(self, file_list, dir_filename_dict={}):
"""文件列表统一排序,给{I+}赋值"""
filename_list = [
# 强制加入`文件修改时间`字段供排序效果1无可排序字符时则按修改时间排序2和目录已有文件重名时始终在其后
f"{f['file_name_re']}_{f['updated_at']}"
f"{f['file_name_re']}{f['updated_at']}"
for f in file_list
if f.get("file_name_re") and not f["dir"]
]
@ -292,7 +289,7 @@ class MagicRename:
if file.get("file_name_re"):
if match := re.search(r"\{I+\}", file["file_name_re"]):
i = filename_index.get(
f"{file['file_name_re']}_{file['updated_at']}", 0
f"{file['file_name_re']}{file['updated_at']}", 0
)
file["file_name_re"] = re.sub(
match.group(),