feat(preflight): 入库前兼容性体检 + 补 AC3 + check 模式

新增 services/preflight.py:ffprobe 判定 READY/PREP/BLOCKED
- 视频 hevc/h264、≤2160p、HEVC level 仅提示;DV5 BLOCKED / DV7 人工确认
- 音频直传白名单走 [Compatibility] direct_audio(默认含 mp2)
- 默认音轨不可直传时提示;无直传轨时 PREP(add_ac3)
- 内嵌 ASS + 大文件且 export 不含 ass 时 PREP(extract_ass)
- add_ac3_track 保留全部音轨、首轨转 AC3 5.1 并设默认;prepare_ac3 备份原文件后原子替换
- TaskManager 新增 prepare 阶段(阶段 0),pipeline 在生成计划时先体检
- main.py 新增 check 模式:全库只体检、输出 preflight_report.csv
- preflight 结果带版本化缓存(preflight_cache.json),避免重复 ffprobe
This commit is contained in:
ali
2026-11-18 23:53:42 +08:00
parent e9c848efe7
commit 3e1ac3c77d
6 changed files with 451 additions and 6 deletions
+4 -2
View File
@@ -74,7 +74,7 @@ class ParserService:
return m_type, title, year, season_num, target_season_folder, root_dir_path, f"{title.replace('.', ' ')} ({year})"
@staticmethod
def get_target_info(f_path: Path, m_type: str, title: str, year: str, season_num: str, is_multi_version: bool = False):
def get_target_info(f_path: Path, m_type: str, title: str, year: str, season_num: str, is_multi_version: bool = False, audio_tag: str = None):
tags = MediaInfoService.get_scene_tags(f_path)
tmdb = TMDBService.search_media(title, year, m_type, season_num)
@@ -87,7 +87,9 @@ class ParserService:
tid = f"[tmdbid-{tmdb['tmdb_id']}]" if (tmdb and config.INCLUDE_TMDB_ID) else ""
source = "BluRay.REMUX" if tags['is_remux'] else "WEB-DL"
tech = f"{tags['res']}.{source}.{tags['v_codec']}.{tags['bits']}.{tags['a_info']}"
# 预补 AC3 时,命名按处理后的音轨来(避免写入真实文件不存在的音轨)
audio_info = audio_tag or tags['a_info']
tech = f"{tags['res']}.{source}.{tags['v_codec']}.{tags['bits']}.{audio_info}"
target_folder = f"{title.replace('.', ' ')} ({year}) {tid}".strip()