mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-09-05 23:47:41 +08:00
fix: latest覆盖模式误删多Part文件 (fix #5862)
This commit is contained in:
@@ -1137,6 +1137,7 @@ class TransHandler:
|
|||||||
meta = MetaInfoPath(path)
|
meta = MetaInfoPath(path)
|
||||||
season = meta.season
|
season = meta.season
|
||||||
episode = meta.episode
|
episode = meta.episode
|
||||||
|
part = meta.part
|
||||||
logger.warn(f"正在删除目标目录中其它版本的文件:{path.parent}")
|
logger.warn(f"正在删除目标目录中其它版本的文件:{path.parent}")
|
||||||
# 获取父目录
|
# 获取父目录
|
||||||
parent_item = storage_oper.get_item(path.parent)
|
parent_item = storage_oper.get_item(path.parent)
|
||||||
@@ -1163,6 +1164,9 @@ class TransHandler:
|
|||||||
# 相同季集的文件才删除
|
# 相同季集的文件才删除
|
||||||
if filemeta.season != season or filemeta.episode != episode:
|
if filemeta.season != season or filemeta.episode != episode:
|
||||||
continue
|
continue
|
||||||
|
# 相同 Part 的文件才删除,避免误删多 Part 文件 (issue #5862)
|
||||||
|
if part and filemeta.part and filemeta.part != part:
|
||||||
|
continue
|
||||||
logger.info(f"正在删除文件:{media_file.name}")
|
logger.info(f"正在删除文件:{media_file.name}")
|
||||||
storage_oper.delete(media_file)
|
storage_oper.delete(media_file)
|
||||||
return True
|
return True
|
||||||
|
|||||||
Reference in New Issue
Block a user