Repository navigation
fix(overlays): derive dynamic-range badges from Dolby Vision metadata - #365
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (9)
📝 WalkthroughWalkthroughBackend and frontend video-range handling now detect Dolby Vision and HDR variants from richer metadata, prioritize the best matching media, and display normalized range labels across item details, version selectors, flyouts, and playback information. ChangesHDR and Dolby Vision range labeling
Estimated code review effort: 3 (Moderate) | ~25 minutes Possibly related issues
Possibly related PRs
Suggested labels: ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c7bca82634
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| for _, track := range file.VideoTracks { | ||
| if track.DolbyVision != "" { | ||
| return 3 |
There was a problem hiding this comment.
Rank all Dolby Vision metadata in tie-breaks
When same-resolution files are compared, this only gives the DV rank to tracks with a non-empty DolbyVision string. The model/API also carries DV through DVProfile and VideoRangeType (and the new web helper handles those fields), so an imported or seeded row with dv_profile or a DOVI... range type but an empty dolby_vision string still ties with generic HDR and can be masked by the first-scanned file, leaving card overlays at generic HDR. Include DVProfile > 0 and/or VideoRangeType with the DOVI prefix in this rank so the new tie-breaker works for all stored DV metadata.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Confirmed reachable — ffprobe writes DolbyVision and DVProfile together, but catalog-seeded tracks take the three fields independently, so dv_profile-only or DOVI*-range-type-only rows exist. Fixed in 244d73e: one shared hasDolbyVision predicate (string, profile > 0, or DOVI-prefixed range type) now feeds both rangeRank and normalizeHDR, matching the web helper; tests added for both paths.
|
I found substantial overlap while auditing #368. This PR predates ours and should own the dynamic-range classification and same-resolution overlay tie-breaking; its subtype vocabulary is also more complete than the implementation currently in #368. I have marked #368 as draft. After this lands, I will rebase and narrow #368 to its unique work: Cross-linking both efforts under #367. No action is required from this branch for our overlap cleanup. |
|
Two robustness details from the overlap comparison are worth folding into this canonical implementation before #368 drops its duplicate range logic:
Suggested regression cases: range-type-only |
Dolby Vision files were labeled with a generic "HDR" badge everywhere
outside the Media Info dialog, because badge sites only consulted the
bare FileVersion.hdr boolean even though the payload carries
video_tracks[].dolby_vision / dv_profile / video_range_type /
color_transfer.
Web: add a shared helper (web/src/lib/videoRange.ts) that derives a
display label ("DV", "DV HDR10", "DV HLG", "HDR10+", "HDR10", "HLG")
from the probed video tracks, mirroring the server-side normalizeHDR
vocabulary, with the hdr boolean kept as the last-resort fallback for
stale pre-DV probe rows. Use it in QualityBadges, VersionDropdown,
VersionFlyout, and the player HUD (playback-info) in place of the
hardcoded "HDR" literal. Badge styling is unchanged.
Server: in internal/overlays/summary.go, break bestFile resolution
ties by richness of dynamic-range metadata (DV > explicit HDR10/HLG
via color_transfer > bare hdr boolean > SDR) so a first-scanned
generic-HDR file no longer masks a Dolby Vision sibling on card
overlays. Full ties still keep the earliest file, so the selection
stays deterministic.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Probed rows set DolbyVision and DVProfile together, but catalog-seeded or imported tracks can carry only dv_profile or a DOVI* video_range_type with an empty dolby_vision string. Share one hasDolbyVision predicate between rangeRank and normalizeHDR so those rows rank and label as DV, matching the web videoRange helper. Co-Authored-By: Claude Opus 4.8 <[email protected]>
244d73e to
35d5f72
Compare
Review follow-up: hdrTypeFromTracks only inspected color_transfer, so server card overlays could never label HDR10+ and a track whose only signal is video_range_type (e.g. catalog-seeded rows without probed color metadata) fell through to the bare-boolean tier of rangeRank — inconsistent with hasDolbyVision, which already reads the range type. The server now shares the web helper's detection order exactly, making the web/server vocabulary mirror claim true. Also drops the unused video_range field from the web VideoRangeTrack interface. Co-Authored-By: Claude Fable 5 <[email protected]>
|
Caution Review failedAn error occurred during the review process. Please try again later. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 35a079fc44
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if (track?.video_range) { | ||
| return track.video_range; | ||
| } | ||
| if (version?.hdr) { | ||
| return "HDR"; | ||
| } | ||
| if (version) { | ||
| return "SDR"; | ||
| return videoRangeLabel(version) || "SDR"; |
There was a problem hiding this comment.
Use detailed range data before coarse video_range
For DV/HDR rows that have the new dv_profile or video_range_type metadata but also still carry the coarse video_range field, this branch returns the old coarse value (HDR/DolbyVision) before the new videoRangeLabel(version) fallback can inspect the detailed fields. That leaves the Current Source File row in the player overlay showing a generic range for exactly the imported/seeded rows this change is trying to handle; prefer the detailed helper before falling back to track.video_range.
Useful? React with 👍 / 👎.
| if hasDolbyVision(file.VideoTracks) { | ||
| return 3 | ||
| } | ||
| if hdrTypeFromTracks(file.VideoTracks) != "" { | ||
| return 2 |
There was a problem hiding this comment.
Rank specific range variants in server rollups
When two same-resolution versions are both DV/explicit HDR but differ in specificity—e.g. a profile-only DV row scanned before a DOVIWithELHDR10Plus row, or HLG before HDR10+—this collapses them to the same rank and keeps the first file. The new web rollup ranks those labels separately, so card overlays can continue to show a generic/lesser range while detail/version badges show the richer one; carry the same label ranking into the server tie-breaker.
Useful? React with 👍 / 👎.
| const rangeLabel = bestVideoRangeLabel(versions); | ||
| if (rangeLabel) badges.push(rangeLabel); |
There was a problem hiding this comment.
Keep range badges tied to the chosen quality tier
When an item has a higher-resolution non-DV version plus a lower-resolution DV version, pickBestAttributes still contributes the higher resolution while this scans every version and returns DV, so the detail header can show adjacent badges like 2160p and DV even though no 2160p DV file exists. Rank the range label from the same selected version/quality tier, or otherwise render it as independent availability, to avoid advertising a nonexistent combination.
Useful? React with 👍 / 👎.
Semantic resolution for the QualityBadges conflict with Silo-Server#365: the selected-version summary now carries the Dolby Vision-aware video range label (videoRangeLabel) instead of the boolean HDR flag, computed from the selected file's video tracks only. Also hardens the variant lookup against missing parts/versions arrays, matching versionRankingUtils. Co-Authored-By: Claude Fable 5 <[email protected]>
Part of #367.
Problem
Files with Dolby Vision show a generic "HDR" badge on detail pages, version pickers, the player HUD, and card overlays. The web badge sites read only the
FileVersion.hdrboolean and push a hardcoded"HDR"literal, even though the payload already carriesvideo_tracks[].dolby_vision/dv_profile/video_range_type/color_transfer(the Media Info dialog renders these correctly). On the server, card-overlay rollup picks the best file by resolution with first-scanned tie-breaking, so one generic-HDR (or stale-probed) file at max resolution masks a DV sibling for a whole card/series.Approach
web/src/lib/videoRange.tsderives a label ("DV", "DV HDR10", "DV HDR10+", "DV HLG", "HDR10+", "HDR10", "HLG") from probed track metadata; thehdrboolean remains the last-resort "HDR" fallback. Used in QualityBadges, VersionDropdown, VersionFlyout, and playback-info. Badge styling unchanged — text/logic only.internal/overlays/summary.go:hdrTypeFromTracksnow readsvideo_range_typeandhdr10_pluswith color transfer as the fallback, sharing the web helper's exact detection order — server card overlays can now label HDR10+, and rows whose only signal is the range-type enum (e.g. catalog-seeded imports) no longer fall through to the bare-boolean tier.internal/overlays/summary.go:bestFilebreaks same-resolution ties by range-metadata richness (DV > explicit HDR10+/HDR10/HLG > bare hdr boolean > SDR); full ties still keep the earliest file, so selection stays deterministic. Unit tests added for tie-breaking,normalizeHDR, and the DV-sibling rollup case.Risks / notes
BuildSummaryderives every overlay field from the single best file, so the new tie-break can also change a card's audio/codec/aspect badges when it flips the winner (e.g. a DV file with AC3 now beats a generic-HDR sibling with Atmos). The previous winner among same-resolution files was arbitrary scan order, so this is a change between two arbitrary-but-deterministic choices, not a regression.video_range_label(additive) on version payloads and the overlay summary so all clients share one source of truth.selectDefaultVersionmatching still uses the boolean and is unaffected.upstream/main(verified).Verification
go build ./...,go test ./internal/overlays/...pass; ESLint/Prettier/tsc clean; videoRange suite plus affected suites pass.AI-use disclosure: implemented by Claude (Claude Code) under human direction and review.
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Bug Fixes