Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions web/src/lib/mediaFormat.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { describe, expect, it } from "vitest";
import {
audioTrackHasAtmos,
audioTrackLabel,
compactHdrSuffix,
formatChannels,
formatCodecLabel,
formatFileSize,
Expand Down Expand Up @@ -103,6 +104,14 @@ describe("prettyResolution", () => {
});
});

describe("compactHdrSuffix", () => {
it("keeps HDR10+, but Dolby Vision wins on a DV + HDR10+ file", () => {
expect(compactHdrSuffix("HDR10+")).toBe("HDR10+");
expect(compactHdrSuffix("DV HDR10+")).toBe("DV");
expect(compactHdrSuffix("HDR10")).toBe("HDR");
});
});

describe("audioTrackLabel", () => {
it("reads Atmos from a track's profile or titles", () => {
const longName = "ATSC A/52B (AC-3, E-AC-3)";
Expand Down
5 changes: 4 additions & 1 deletion web/src/lib/mediaFormat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,13 @@ export function prettyResolution(value: string | undefined): string | null {
}

// Compact HDR suffix used for combined Resolution+HDR badges. Any Dolby
// Vision variant collapses to "DV"; any other HDR variant to "HDR".
// Vision variant collapses to "DV", HDR10+ hybrids included, so the badge
// stays short next to one in the opposite corner. HDR10+ keeps its name;
// any other HDR variant collapses to "HDR".
export function compactHdrSuffix(value: string | undefined): string | null {
if (!value) return null;
if (value.includes("DV")) return "DV";
if (value.includes("HDR10+")) return "HDR10+";
return "HDR";
}

Expand Down
3 changes: 2 additions & 1 deletion web/src/lib/overlays/registry/tech.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ export const TECH_OVERLAYS: readonly OverlayDef[] = [
id: "resolution_hdr",
category: "tech",
label: "Resolution + HDR (combined)",
description: 'Single badge combining resolution and dynamic range (e.g. "4K DV", "1080p HDR")',
description:
'Single badge combining resolution and dynamic range (e.g. "4K DV", "4K HDR10+", "1080p HDR")',
defaultPosition: "top-left",
defaultEnabled: false,
iconCapable: true,
Expand Down
Loading