feat: VR metadata support for VideoFile - #7048
Conversation
- Add projection, stereo_mode, vr_corrections columns to video_files (migration 86) - New types: ProjectionEnum, StereoModeEnum, VRCorrections in pkg/models/file_vr.go - VideoFile model fields + JSON import/export schema - FileVRMetadataWriter interface + ModifyVideoFileMetadata implementation - GraphQL schema: VideoFile fields, VRCorrections type, FileSetVRMetadata mutation - Resolver: FileSetVRMetadata mutation with input validation - UI: VideoFileData fragment + SceneFileInfoPanel read-only display - Integration test: ModifyVideoFileMetadata round-trip Addresses: stashapp#3003
|
God, this screams AI nonsense. |
- Add projection, stereo_mode, vr_corrections columns to video_files (migration 86) - New types: ProjectionEnum, StereoModeEnum, VRCorrections in pkg/models/file_vr.go - VideoFile model fields + JSON schema import/export round-trip - FileVRMetadataWriter interface + ModifyVideoFileMetadata implementation - GraphQL schema: VideoFile fields, VRCorrections type, FileSetVRMetadataInput, fileSetVRMetadata mutation - Resolver: FileSetVRMetadata with input validation - UI: VideoFileData fragment + SceneFileInfoPanel read-only display - Integration test: ModifyVideoFileMetadata round-trip (3 cases) Reopen: refresh head SHA to clear phantom merge state from earlier close cycle. Template-compliant body, scope unchanged.
Re-submission after stashapp#7045 was closed by collaborator for PR template violation. Same code, template-compliant body, AI Usage Disclosure checked. - Migration 86: ALTER TABLE video_files adds projection, stereo_mode, vr_corrections - New types: ProjectionEnum, StereoModeEnum, VRCorrections in pkg/models/file_vr.go - VideoFile model fields + JSON schema import/export round-trip - FileVRMetadataWriter interface + ModifyVideoFileMetadata implementation - GraphQL schema: VideoFile fields, VRCorrections type, FileSetVRMetadataInput, fileSetVRMetadata mutation - Resolver: FileSetVRMetadata with input validation - UI: VideoFileData fragment + SceneFileInfoPanel read-only display - Integration test: ModifyVideoFileMetadata round-trip (3 cases) Scope confirmed by @WithoutPants in stashapp#3003 comment 4703564363 (2026-06-15).
Check the json.Marshal error in vrCorrectionsToNullString instead of discarding it — errchkjson flags the discarded error because VRCorrections can hold float64 fields (NaN/Inf produce invalid JSON). Return an empty null.String on marshal failure, matching the nil-input path. Run gofmt -w on the four files golangci-lint flagged for formatting (const block alignment in file_vr.go, struct tag columns in file_folder.go and model_file.go, and the broader file.go cleanup).
ProjectionEnum: add CUBEMAP, RECTILINEAR (matches ffmpeg v360 filter) StereoModeEnum: add AF, INTERLEAVED_ROWS (matches ffmpeg stereo3d filter) VRCorrections: drop brightness/contrast/saturation, add alpha_mode Suggested by philpw99 in stashapp#3003 — brightness/contrast/saturation are player-side preferences, not file metadata. Alpha mode is in the DeoVR spec.
WithoutPants
left a comment
There was a problem hiding this comment.
This is looking mostly ok, just some minor issues.
| projection: String | ||
| stereo_mode: String |
There was a problem hiding this comment.
You've added enum types to the models package, but haven't defined them in the graphql schema and aren't using them in the applicable fields.
| // VRCorrections holds optional per-video corrections commonly | ||
| // applied when projecting stereoscopic or 360-degree content. | ||
| // All fields are optional; nil means "unset". | ||
| // AlphaMode follows DeoVR's alpha channel specification. |
There was a problem hiding this comment.
Probably needs better documentation than just referencing DeoVR. What is the alpha channel specification?
There was a problem hiding this comment.
Probably needs better documentation than just referencing
DeoVR. What is the alpha channel specification?
DeoVR now has 3 passthrough modes: Chroma Key, Alpha Packing and AI Alpha.
https://deovr.com/blog/136-testing-the-different-types-of-passthrough-at-deovr
The ones we can commonly use are Chroma Key and Alpha Packing.
For Chroma Key, we need 5 key/value pairs: Hue, Saturation, Brightness, Color Range and Falloff. All of them are int numbers.
For Alpha Packing, the video needs to be Fisheye SBS 3D. No value is needed.
Description
Adds VR metadata columns +
fileSetVRMetadatamutation, mirroring theexisting
fileSetFingerprintsshape. UI is read-only; editor follows.Related Issue
Closes #7071
Testing
go vet ./...go build ./...make gqlgenmake lintmake ui-validateChecklist
AI Usage Disclosure
LLM drafted the GraphQL schema and resolver boilerplate. Migration,
resolver wiring, integration test, and all local checks were done by
hand.
Additional Context
DeoVR HTTP endpoints are plugin-space (per #3794), not in this PR.