Merge pull request #2460 from thsrite/main

This commit is contained in:
jxxghp 2024-06-30 09:08:35 +08:00 committed by GitHub
commit 58da0ebb4f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -949,6 +949,11 @@ class TransferChain(ChainBase):
for file in files:
Path(file).unlink()
logger.warn(f"文件 {path} 已删除")
# 删除thumb图片
thumb_file = path.parent / (path.stem + "-thumb.jpg")
if thumb_file.exists():
thumb_file.unlink()
logger.info(f"文件 {thumb_file} 已删除")
# 需要删除父目录
elif str(path.parent) == str(path.root):
# 根目录,不删除