Unify metadata attachments across web and desktop - #1807
Open
PaulHax wants to merge 2 commits into
Open
Conversation
This was referenced Jul 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Second of a four-PR stack, on top of #1806. Review only this PR's own commits; the base branch
carries #1806's changes.
Summary
One optional metadata attachment per dataset scope, consistent across web and desktop.
Single-camera datasets get one shared attachment; multicamera datasets get one shared parent
attachment plus one camera-local attachment per camera, camera-local taking precedence. Image
sequences and videos are supported from the start. JSON, TXT, and CSV stay opaque pipeline inputs
here — row parsing is the next PR.
Carried through: web and desktop creation-time selection; headless and RPC ingestion; single-camera
and multicamera imports; clone-root lookup; export/import round trips; pipeline discovery and opt-in
injection; and a normalized
GET /dive_dataset/:id/frame_metadata_sources.Reserved
frame-metadata.*andframe_metadata.*names are recognized identically by Python andTypeScript, pinned by a shared conformance fixture, and never sent through annotation parsing.
The read path — the source endpoint, the web and desktop loaders, and
loadFrameMetadataon theApiinterface — lands here with no production consumer, because it is the attachment contractand the next PR is its first caller. Review it against
test_frame_metadata_sources.py, not a UI.Two changes outside the attachment story ride along:
process_itemsimported every CSV, last write winning. It nowimports the oldest and names the rest in a warning, so the headless sweep enforces the rule Upload exactly the server-validated package #1806
enforces interactively. The sweep is already rewritten here to pre-scan for reserved names.
_inject_dataset_metadata_filereconstructed<dir>/<item name>,wrong when girder_client sanitizes or nests the name — in the nested case
exists()passes and adirectory is bound into the KWIVER setting. It now locates what actually landed.
The write-only
metadataFileitem marker and its helper are dropped; nothing ever read it, and thefolder's
metadataFileItemIdis the only attachment locator. Items in existing datasets keep thestale key harmlessly.
Reviewer focus
is the user's own content, uploaded with the media and merely discovered — and
process_itemsrecords what it discovers in the same marker, so ownership is decided by the reserved-name
predicate, not the marker's presence.
annotation pick it is removed from the package rather than swapped into it — it is uploaded and
declared separately once the camera dataset exists — and a folder file it displaces is still
reported.
directories for different cameras do not collide.
Manual test
Uses
okeanos-frame-metadata-upload,okeanos-video-explicit-frame, andokeanos-video-opaque-jsonfrom
okeanos-frame-metadata-fixtures.zip, attached to #1806 — CC0 NOAA Okeanos Explorer media withsynthetic metadata and annotations. Select all files in one directory per test.
In
okeanos-frame-metadata-uploadboth slots fill at once:annotations.csvis theannotation pick and
frame-metadata.csvthe attachment, from a single selection of two CSVs.attachment contributes none.
GET /api/v1/dive_dataset/<folder-id>/frame_metadata_sources— onesharedobject with anitemId, the original name, and an emptycamerasobject.frame_metadata.json— stored for pipelines, notinterpreted, and the underscore spelling is discovered exactly like the hyphen one.
Desktop smoke test: import a media directory, choose its sidecar in Metadata File,
export the archive, reopen, and confirm the attachment name survives.