From 04ca437054b31a52d65019b38dbe05ab6ee17907 Mon Sep 17 00:00:00 2001 From: nessi Date: Fri, 14 Aug 2026 14:30:22 +0200 Subject: [PATCH] feat: merge external subtitle files with embedded subtitle languages in media row display Update media_row() to combine embedded subtitle_languages from ffprobe with external subtitle files detected via external_subtitle_languages(). Apply unique_langs() to deduplicate language codes when local_path is available, ensuring both .mkv internal subs and external .srt/.ass files appear in the subtitle language list. --- app.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app.py b/app.py index 01c5c91..8abe2e0 100644 --- a/app.py +++ b/app.py @@ -266,6 +266,8 @@ def media_row(name, year, media_file, remote, local, extra=None): if not path and media_file and media_file.get("relativePath"): path = str(Path(media_file.get("basePath") or "") / media_file["relativePath"]) local_path = map_path(path, remote, local); info = cached(local_path) if local_path else {"error":"Kein Dateipfad erhalten"} info = info or {"pending": True}; audios = info.get("audio_languages", []) + if local_path: + info["subtitle_languages"] = unique_langs(info.get("subtitle_languages", []) + external_subtitle_languages(local_path)) downloading = bool((extra or {}).get("downloading")) quality = ((((media_file or {}).get("quality") or {}).get("quality") or {}).get("name")) or "—" row = {"title":name, "year":year, "quality":"Downloading" if downloading else (quality if media_file else "Keine Datei"), "audio_languages":audios, "subtitle_languages":info.get("subtitle_languages", []), "video_codec":info.get("video_codec", "—"), "size":format_size(info.get("size") or (media_file or {}).get("size")), "radarr_path":path or "—", "local_path":local_path or "—", "state":{"class":"downloading", "label":"Downloading"} if downloading else (language_state(audios) if audios else {"class":"neutral", "label":"Scan ausstehend" if info.get("pending") else ("Fehler" if info.get("error") else "Keine Spuren")}), "error":info.get("error"), "missing":not bool(media_file), "pending":bool(info.get("pending")), "downloading":downloading}