♻️ 插件 alist_sync 修改为不同步子目录 (#99)
Some checks failed
Docker Publish / build-and-push (push) Has been cancelled

* ♻️ 修改为不同步子目录:先暂时修改为不同步子目录,原因是目前不清楚通过调用API创建任务时,是否会将原有的文件进行覆盖,后续测试修改完毕后再将此项迁移至TV模式下启用

* ♻️ 增加获取文件列表失败提示:有2个原因会导致代码报错:1.api刷新的为最底层目录,如果保存的目录被删除且上层目录未刷新时,获取的是假的文件列表,可能会为空,则报错2.网络不好获取目录失败。增加提示告诉用户原因
This commit is contained in:
jenfonro 2025-07-18 18:25:59 +08:00 committed by GitHub
parent b153b2aaf6
commit 518037cee8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -164,7 +164,9 @@ 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:
@ -228,6 +230,10 @@ 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:
target_list_filename = (
target_list["name"]