Skip to content

feat: VR metadata support for VideoFile - #7048

Open
kwanter wants to merge 5 commits into
stashapp:developfrom
kwanter:feat/vr-metadata-3003-v2
Open

feat: VR metadata support for VideoFile#7048
kwanter wants to merge 5 commits into
stashapp:developfrom
kwanter:feat/vr-metadata-3003-v2

Conversation

@kwanter

@kwanter kwanter commented Jun 15, 2026

Copy link
Copy Markdown

Description

Adds VR metadata columns + fileSetVRMetadata mutation, mirroring the
existing fileSetFingerprints shape. UI is read-only; editor follows.

Related Issue

Closes #7071

Testing

  • go vet ./...
  • go build ./...
  • make gqlgen
  • make lint
  • make ui-validate
  • integration test (3/3)
  • fork CI — needs maintainer trigger

Checklist

  • I have read and understood the Contributing document.
  • I have read and understood the AI Usage Policy document.
  • I have made corresponding changes to the documentation (if applicable).

AI Usage Disclosure

  • I have used AI tools to assist with this pull request, and I have disclosed the tools and how I used them below.

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.

- 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
@kwanter kwanter mentioned this pull request Jun 15, 2026
@kwanter

kwanter commented Jun 15, 2026

Copy link
Copy Markdown
Author

Re-submitted as #7048#7045 was closed because I left the AI Usage Disclosure box unchecked. Same code, same scope, same diff you already saw in #3003. Body now matches the template and the box is checked. No need to reopen the old one; happy to keep discussion here.

@Gykes

Gykes commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

God, this screams AI nonsense.

kwanterpepen and others added 4 commits June 15, 2026 15:00
- 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 WithoutPants left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking mostly ok, just some minor issues.

Comment on lines +96 to +97
projection: String
stereo_mode: String

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread pkg/models/file_vr.go
// 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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably needs better documentation than just referencing DeoVR. What is the alpha channel specification?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@WithoutPants WithoutPants added the improvement Something needed tweaking. label Jun 25, 2026
@WithoutPants WithoutPants added this to the Version 0.32.0 milestone Jun 25, 2026
@DogmaDragon DogmaDragon changed the title feat: DeoVR VR metadata support for VideoFile (#3003) feat: VR metadata support for VideoFile Jun 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Something needed tweaking.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add VR specific fields to VideoFile

5 participants