fix: latest覆盖模式误删多Part文件 (fix #5862)

This commit is contained in:
jxxghp
2026-05-30 20:28:26 +08:00
parent 314ac3903c
commit 2255b61195

View File

@@ -1137,6 +1137,7 @@ class TransHandler:
meta = MetaInfoPath(path)
season = meta.season
episode = meta.episode
part = meta.part
logger.warn(f"正在删除目标目录中其它版本的文件:{path.parent}")
# 获取父目录
parent_item = storage_oper.get_item(path.parent)
@@ -1163,6 +1164,9 @@ class TransHandler:
# 相同季集的文件才删除
if filemeta.season != season or filemeta.episode != episode:
continue
# 相同 Part 的文件才删除,避免误删多 Part 文件 (issue #5862)
if part and filemeta.part and filemeta.part != part:
continue
logger.info(f"正在删除文件:{media_file.name}")
storage_oper.delete(media_file)
return True