diff --git a/pvd_mezzanine.py b/pvd_mezzanine.py index 154b59b..fbe5153 100644 --- a/pvd_mezzanine.py +++ b/pvd_mezzanine.py @@ -289,12 +289,13 @@ def extract_title(input_path: str) -> str: return title or "UNKNOWN_TITLE" -def get_pvd_filename(input_path: str) -> str: - """MP4-Ausgabename: Quell-Stem + _PVD; bei Blu-ray: konstruierter Titel + _PVD.""" +def get_pvd_filename(input_path: str, mp4_audio_token: str) -> str: + """MP4-Ausgabename: Stem ohne fremde Audio-Tokens + ausgewaehlter Token + _PVD.""" path = Path(input_path) if "BDMV" in [p.upper() for p in path.parts]: - return f"{extract_title(input_path)}_PVD.mp4" - return f"{path.stem}_PVD.mp4" + return f"{extract_title(input_path)}_{mp4_audio_token}_PVD.mp4" + stem = strip_audio_tokens(path.stem) + return f"{stem}_{mp4_audio_token}_PVD.mp4" def get_mov_stem(input_path: str) -> str: @@ -484,7 +485,7 @@ def build_plan(input_file: str, output_dir: str = OUTPUT_BASE_DIR) -> JobPlan: selected_mp4_audio = select_mp4_german_audio(audio_roles) output_base = Path(output_dir) - pvd_mp4 = str(output_base / get_pvd_filename(input_file)) + pvd_mp4 = str(output_base / get_pvd_filename(input_file, role_token(selected_mp4_audio))) mov_stem = get_mov_stem(input_file) german_roles = [role for role in audio_roles if role.is_german] original_roles = [role for role in audio_roles if not role.is_german]