mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-11-03 05:44:44 +08:00
fix(storage): preserve transfer contents and cleanup identities (#7142)
This commit is contained in:
@@ -153,10 +153,7 @@ def _audio_write_target(path: Path) -> Iterator[Path]:
|
||||
shutil.copy2(path, temporary)
|
||||
# NAS ACL 挂载可将可读源文件映射为 000;只给独立副本补齐读写权限,源权限保持不变。
|
||||
temporary.chmod(stat.st_mode | S_IRUSR | S_IWUSR)
|
||||
initial_copy = _audio_signature(temporary)
|
||||
yield temporary
|
||||
if _audio_signature(temporary) == initial_copy:
|
||||
return
|
||||
if path.lstat().st_ino != link_inode or _audio_signature(path) != signature:
|
||||
raise OSError("标签写入期间目标文件已变化,保留当前目标并取消替换")
|
||||
temporary.replace(path)
|
||||
|
||||
@@ -107,6 +107,7 @@ def success_fields(
|
||||
image=mediainfo.get_poster_image(),
|
||||
downloader=downloader,
|
||||
download_hash=download_hash,
|
||||
episode_group=mediainfo.episode_group,
|
||||
status=True,
|
||||
retry_count=0,
|
||||
auto_paused=False,
|
||||
|
||||
Reference in New Issue
Block a user