feat: add "Without German" tab to filter media missing German audio or subtitles
Add new navigation tab showing count of movies and episodes without German tracks. Implement has_german_track() helper to check for German audio or subtitles. Filter movies and series to create missing_german_movies and missing_german_series lists passed to template. Add dedicated view section with tables for movies and series lacking German content, including empty state message. Update navigation translation logic
This commit is contained in:
1 parent
1558b081dd
commit
7b788f7dc8
2 files changed
+22
-3
No files matched your search
@@ -153,6 +153,10 @@ def language_state(audios):
|
||||
if "Englisch" in names: return {"class":"bad", "label":"English only"}
|
||||
return {"class":"neutral", "label":"Andere"}
|
||||
|
||||
def has_german_track(row):
|
||||
languages = row.get("audio_languages", []) + row.get("subtitle_languages", [])
|
||||
return any(language.get("name") == "Deutsch" for language in languages)
|
||||
|
||||
def media_row(name, year, media_file, remote, local, extra=None):
|
||||
path = media_file.get("path") if media_file else None
|
||||
if not path and media_file and media_file.get("relativePath"): path = str(Path(media_file.get("basePath") or "") / media_file["relativePath"])
|
||||
@@ -224,7 +228,17 @@ def index():
|
||||
series = sonarr_groups()
|
||||
if any(row["pending"] for group in series for row in group["episodes"]): start_scan("sonarr")
|
||||
except Exception as exc: log.exception("Sonarr nicht erreichbar"); error = f"{error + ' | ' if error else ''}Sonarr: {exc}"
|
||||
return render_template("index.html", rows=rows, series=series, error=error, sonarr_enabled=bool(SONARR_URL and SONARR_API_KEY), sab_enabled=bool(SAB_URL and SAB_API_KEY), radarr_media_path=RADARR_MEDIA_PATH, local_media_path=LOCAL_MEDIA_PATH, local_series_path=LOCAL_SERIES_PATH)
|
||||
missing_german_movies = [row for row in rows if not has_german_track(row)]
|
||||
missing_german_series = []
|
||||
for group in series:
|
||||
episodes = [episode for episode in group["episodes"] if not has_german_track(episode)]
|
||||
if episodes:
|
||||
missing_german_series.append({**group, "episodes": episodes})
|
||||
return render_template("index.html", rows=rows, series=series, missing_german_movies=missing_german_movies,
|
||||
missing_german_series=missing_german_series, error=error,
|
||||
sonarr_enabled=bool(SONARR_URL and SONARR_API_KEY), sab_enabled=bool(SAB_URL and SAB_API_KEY),
|
||||
radarr_media_path=RADARR_MEDIA_PATH, local_media_path=LOCAL_MEDIA_PATH,
|
||||
local_series_path=LOCAL_SERIES_PATH)
|
||||
|
||||
@app.post("/api/rescan")
|
||||
def api_rescan():
|
||||
|
||||
Reference in new issue
Block a user