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

@@ -368,7 +368,7 @@ def rename(
runtime_config.media_extensions + runtime_config.subtitle_extensions + runtime_config.audio_extensions
)
# 递归修改目录内文件(智能识别命名)
sub_files: List[_SchemaFileItem] = StorageChain().list_files(fileitem) or []
sub_files: List[_SchemaFileItem] = StorageChain().list_files(fileitem, recursion=True) or []
if sub_files:
# 开始进度
progress = ProgressHelper(ProgressKey.BatchRename)
@@ -384,7 +384,7 @@ def rename(
continue
if f".{sub_file.extension.lower()}" not in media_exts:
continue
sub_path = Path(f"{fileitem.path}{sub_file.name}")
sub_path = Path(sub_file.path or "")
context = MediaChain().recognize_by_path(
sub_path,
obtain_images=False,

View File

@@ -66,6 +66,10 @@ def restore_manual_transfer_history_batch(
_common_history_value(histories, "music_type")
or transer_item.music_type
)
transer_item.episode_group = (
_common_history_value(histories, "episode_group")
or transer_item.episode_group
)
downloader = _common_history_value(histories, "downloader")
download_hash = _common_history_value(histories, "download_hash")
logger.info("手动整理历史批次还原 %s 个源文件", len(src_fileitems))