Skip to content

feat(media): store a media file's pixel size, size and MD5 in the project (rc15, 869fat84r) - #13

Merged
ibiltari merged 5 commits into
mainfrom
feat/869fat84r-media-dimensions
Oct 6, 2026
Merged

ibiltari merged 5 commits into
mainfrom
feat/869fat84r-media-dimensions

Conversation

@ibiltari

@ibiltari ibiltari commented Oct 5, 2026

Copy link
Copy Markdown
Member

Why

A GO sent right after a cue selection could start up to 400 ms late (ClickUp 869fat84r): the node engine ran ffprobe for a video file's width and height when it armed the cue, while holding its command lock. The editor already stores each media file's duration in the project; it now stores the pixel size, the file size and the MD5 the same way, and the engine reads them instead of probing (cuems-engine PR #22).

What

  • script.xsd MediaType: four optional elements after regions: pixel_width, pixel_height, file_size (xs:positiveInteger) and file_md5 (Md5Type, 32 lowercase hex digits).
  • Media accessors for them.
  • The builder writes Media in schema order and never writes an empty element.
  • The parser keeps file_md5 a string: an all-digit MD5 used to be coerced to an int.
  • Release 0.1.0rc15.

Compatibility

  • Projects without the elements load and save as before.
  • A project with them needs rc15, or an older utils with an XSD-only patch. Patches for rc14 and pre_release_1 are built and proven against real projects (cuems-RELATIONS/baselines/869fat84r-xsd-patch).
  • Release order: publish rc15 to PyPI before building the cuems-editor deb. dh-virtualenv resolves cuemsutils from PyPI.

Tests

  • New: tests/unit/test_media_pixel_dimensions.py.
  • Full suite on test2: 610 passed.

Design and results: cuems-RELATIONS/Plans/2026-10-01-engine-late-go-media-probe.md. Related: cuems-editor feat/869fat84r-media-dimensions, cuems-engine #22, cuems-frontend feat/869fat84r-media-check.

Media gains optional pixel_width / pixel_height / file_size, appended to
MediaType after regions, so the engine stops running ffprobe on the arm path.
Covers the setters, the writer (schema order whatever the dict order, no empty
element for None) and the parse path, which never calls the setters.
…t (869fat84r)

MediaType gains three optional elements after regions: pixel_width and
pixel_height (the original size of the file's first video stream, as ffprobe
reports it) and file_size (bytes, when they were measured). The editor
measures them at upload, as it does the duration, so the node engine no longer
runs ffprobe while arming a video cue under the command lock: a GO sent right
after a cue selection started up to 400 ms late on that probe.

- script.xsd: xs:positiveInteger, minOccurs=0; absent means unknown.
- Media: pixel_width / pixel_height / file_size properties. A positive int or
  a string of digits is stored as int; None removes the key; anything else
  raises ValueError.
- MediaXmlBuilder writes Media in schema order whatever the dict order (the
  editor appends the values after what the frontend sent, and the parsers keep
  arrival order) and writes no element for a None dimension (an empty
  <pixel_width/> fails the schema).

Older utils lines reject a project carrying these elements; they are made to
accept it by replacing only script.xsd (their parsers keep unknown Media keys
as plain ints and their code never reads them).

Design: cuems-RELATIONS Plans/2026-10-01-engine-late-go-media-probe.md
…4r D18) (red)

The file's MD5 identifies it unambiguously, for integrity checks: a corrupt or
partial copy can have the right size. It is the MD5 the upload already carries.
file_size and file_md5 apply to every media type; the pixel size stays
VideoCue-only. An MD5 shaped like a number (all digits, or digits with one 'e')
must survive the parser, which coerces such strings to int/float.
…at84r D18)

- script.xsd: optional file_md5 (Md5Type, 32 lowercase hex) after file_size;
  the comment states that file_size and file_md5 apply to every media type.
- Media.file_md5: any case in, lowercase stored; None removes it; anything that
  is not 32 hex digits raises ValueError.
- MediaXmlBuilder: file_md5 in the schema order, no element for None.
- Parsers.STRING_TYPED_KEYS gains file_md5: str_to_value turned an all-digit
  MD5 into an int and digits-with-one-e into a float (about one MD5 in a
  million), which would then fail the schema on the next save.

Design: cuems-RELATIONS Plans/2026-10-01-engine-late-go-media-probe.md D18
Ships the stored media metadata (869fat84r): pixel_width / pixel_height
(VideoCues) and file_size / file_md5 (every media type) in MediaType; and,
from main, 9c17418: the engine-native fade curve names ease_in / ease_out.
All are additive schema changes.

Refs ClickUp 869fat84r
@codecov

codecov Bot commented Oct 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@ibiltari
ibiltari merged commit d652494 into main Oct 6, 2026
5 checks passed

This branch was successfully deployed

1 active deployment
pypi — f027750a Deployed Oct 6, 2026 by backenv via pypi-publish #26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants