fix(storage): preserve transfer contents and cleanup identities (#7142)

This commit is contained in:
Aqr-K
2026-10-23 06:51:54 +08:00
committed by GitHub
parent 5aebc7ac59
commit f3c1449c8b
24 changed files with 874 additions and 111 deletions

View File

@@ -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)

View File

@@ -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,