feat(web): movie detail page at /movies/{id}
This commit is contained in:
@@ -257,6 +257,39 @@ export function bucketOf(release: MovieRelease): Bucket {
|
||||
return "rejected";
|
||||
}
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
export function probedAttributeTags(probed: unknown): string[] {
|
||||
if (probed === null || typeof probed !== "object") {
|
||||
return [];
|
||||
}
|
||||
const probe = probed as {
|
||||
resolution?: string | null;
|
||||
source?: string | null;
|
||||
hdr?: string | null;
|
||||
audio_tracks?: { language?: string | null }[] | null;
|
||||
};
|
||||
const tags: string[] = [];
|
||||
if (probe.resolution) {
|
||||
tags.push(probe.resolution);
|
||||
}
|
||||
if (probe.source) {
|
||||
tags.push(probe.source);
|
||||
}
|
||||
if (probe.hdr && probe.hdr !== "SDR") {
|
||||
tags.push(probe.hdr);
|
||||
}
|
||||
for (const track of probe.audio_tracks ?? []) {
|
||||
if (track.language) {
|
||||
tags.push(track.language);
|
||||
}
|
||||
}
|
||||
return tags;
|
||||
}
|
||||
|
||||
/* ---- chip formatting: parsed attributes to fixed-width mono values ---- */
|
||||
|
||||
const SOURCE_LABEL: Record<string, string> = {
|
||||
|
||||
Reference in New Issue
Block a user