fix(web): one language chip per file, not per track
ci / web (push) Successful in 35s
ci / rust (push) Successful in 1m45s
e2e / e2e (push) Failing after 3m25s

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.
This commit is contained in:
Miguel Palhas
2026-08-26 18:42:40 +01:00
parent 58ad90951c
commit 5610e5976d
+7 -1
View File
@@ -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<string>();
for (const track of probe.audio_tracks ?? []) {
if (track.language) {
tags.push(track.language);
languages.add(track.language);
}
}
tags.push(...languages);
return tags;
}