From 5610e5976db21d4acfca58377d5d2acea189b8cc Mon Sep 17 00:00:00 2001 From: Miguel Palhas Date: Wed, 26 Aug 2026 18:42:40 +0100 Subject: [PATCH] fix(web): one language chip per file, not per track Commentary tracks carry the same language as the feature audio, so a file row rendered `en` two or three times. The chips answer what a file can be watched in; repeats say nothing the first said. --- web/src/releases.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/web/src/releases.ts b/web/src/releases.ts index edfdf87..961c631 100644 --- a/web/src/releases.ts +++ b/web/src/releases.ts @@ -357,6 +357,8 @@ export function bucketOf(release: MovieRelease): Bucket { * The probed attributes a file row shows as chips (§5.6, §7.4) — ffprobe * truth, not name claims. Shared by movie and episode file rows; the probe * JSON arrives untyped from the API, so the shape is narrowed here. + * + * Audio is reported as the set of languages present, one chip each. */ export function probedAttributeTags(probed: unknown): string[] { if (probed === null || typeof probed !== "object") { @@ -378,11 +380,15 @@ export function probedAttributeTags(probed: unknown): string[] { if (probe.hdr && probe.hdr !== "SDR") { tags.push(probe.hdr); } + // Set, not push: commentary tracks repeat the feature audio's language, + // and no test catches a row that renders `en` three times. + const languages = new Set(); for (const track of probe.audio_tracks ?? []) { if (track.language) { - tags.push(track.language); + languages.add(track.language); } } + tags.push(...languages); return tags; }