Repository navigation
Conversation
…ed before Silo-Server#4487 AV1 Dolby Vision Profile 10 tracks scanned before Silo-Server#4487 kept video_range_type DOVI even when their configuration record names a compatible base layer. New scans store DOVIWithHDR10 (or DOVIWithHDR10Plus), DOVIWithSDR or DOVIWithHLG, and the Jellyfin API corrects old rows on read, but the native /api/v2 returned the stored DOVI until the file changed on disk. A one-off migration rewrites those stored tracks with the mapping mediaprobe.Profile10RangeType applies: base-layer compatibility id 1 (HDR10, or HDR10+ with hdr10_plus), 2 (SDR) and 4 (HLG). A track with no id or an unmapped one stays DOVI, as a scan leaves it, and every other track keeps its value and position. Closes Silo-Server#5244 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedThis organization requires a seat for paid usage-based reviews, including automatic and on-demand reviews. Ask an admin to assign a seat or enable paid usage-based reviews for users without a seat in Billing. Next included review available in 28 minutes. View limit details
|
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
The backfill built each new track array in a subquery over its own snapshot of media_files and assigned it through UPDATE ... FROM. When another server rewrote a matching row and committed while the migration waited on that row's lock, PostgreSQL rechecked only the join condition and wrote the array built from the old row over the newer scan. Build the array from mf.video_tracks in SET instead, so PostgreSQL re-evaluates both the filter and the new value against the committed row. Also run TestProfile10RangeTypeBackfillPostgres in CI through scripts/ci/db-contracts.txt, and drop the executable bit from both files. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Quick104
left a comment
There was a problem hiding this comment.
🤖 Claude Code (claude-opus-5-5)
Two findings below, both of which I'm fixing in a commit on this branch. The mapping matches mediaprobe.Profile10RangeType and what jellycompat already computes on read.
One nit, also fixed in that commit: both new files have mode 100755. They are the only executable files under migrations/.
Silo Kody — review completeReview finished. Check the inline comments for findings and verify each suggestion against the code and tests. Reviewing changes in Silo
Review settingsReview OptionsThe following review options are enabled or disabled:
|
|
🤖 Claude Code (claude-opus-5-5) Review summaryReviewed head: 138546a (the contributor's 2b410c9 plus one review-fix commit). The migration does what #5244 asks. Stored Profile 10 tracks with compat id 1, 2 or 4 get the range type a fresh scan stores, and every other track keeps its value and position. The mapping matches Addressed findings
Verification
Evidence: https://evidence.siloserver.org/r/silo-server/pr-5472-review/ Considered and left as is
Validated featuresNo passed 1.0 case is affected. Playback planning, tone mapping, and overlay ranking make the same decisions for Other checks
CouncilSol (gpt-6.2-sol), Opus (claude-opus-5-5) and Gemini (gemini-4-neon), each at medium effort.
Fit: 9/10 · Readiness: 9/10 — ready (assuming CI is green)
|
Depends on: none. Merge order: none. Follows #4487 (merged).
Problem
Closes #5244
Related issue: #4487
Validation tasks: none
Other clients: all native
/api/v2clients (web, Android, Apple) now read the corrected range type for these files. The Jellyfin-compatible API already corrected it on read, so it is unchanged.AV1 Dolby Vision Profile 10 files scanned before #4487 kept
video_range_type: "DOVI"in their stored video track, even when the Dolby Vision configuration record names a compatible base layer (dv_bl_compat_id1, 2 or 4). #4487 made new scans storeDOVIWithHDR10(orDOVIWithHDR10Plus),DOVIWithSDRorDOVIWithHLG, and made the Jellyfin-compatible API correct old rows on read (compatVideoRangeType). Nothing rewrote the stored rows, so the native API returned the oldDOVIuntil the file changed on disk.Approach
20261127143000_profile10_range_type_backfill.sql) rewrites stored tracks withdv_profile10,video_range_typeDOVI anddv_bl_compat_id1, 2 or 4. It uses the mapping ofmediaprobe.Profile10RangeType: 1 givesDOVIWithHDR10, orDOVIWithHDR10Pluswithhdr10_plus; 2 givesDOVIWithSDR; 4 givesDOVIWithHLG.@?) selects them.DOVIcan't be told apart from a genuine one, and the new value is what a scan stores today.compatVideoRangeType's read-time correction in place. It is now a no-op for migrated rows, and removing it can follow separately.Validation
TestProfile10RangeTypeBackfillPostgres(migrations/), with one row per case: compat ids 1, 1 with HDR10+, 2 and 4 get rewritten; no id, an unmapped id (6) and a Profile 8 track stay DOVI; a two-track row keeps its second track; a row without tracks is untouched. Passes.go test ./migrations/(withSILO_TEST_DATABASE_URL): pass.make verify-migrations: pass.go vet: clean.golangci-linton the changed package (pre-commit): 0 issues.scripts/ci/db-contracts.txt, so CI runs it.go run ./cmd/silo --migrate-onlyapplied the migration to a fully migrated database seeded with old rows: compat ids 1, 1 with HDR10+, 2 and 4 were rewritten; a track with no id and a Profile 8 track kept their values.Evidence
Evidence: not needed. No visible change in the apps' layout; the change is a stored value the API returns, shown by the test above.
Without this migration, the same rows keep
DOVI, which is what the native API returns today.Risks
media_filesonce at startup, but writes only rows that have a matching track.video_tracksfires the same change triggers a rescan of these files would.Checklist
AI Disclosure
🤖 Generated with Claude Code
Note
Backfill real range type for Profile 10 tracks in media-file migration
DOVIWithHDR10/DOVIWithHDR10Plus(byhdr10_plusflag),DOVIWithSDR, andDOVIWithHLGrespectively. See 20261127143000_profile10_range_type_backfill.sqlrange_typedata in the media-file table; the Down migration does not roll it backMacroscope summarized 138546a.