Repository navigation
feat(catalog): emit schemaVersion, thumbnailUrl, and per-item media specs - #71
Merged
Merged
Conversation
…pecs
Extend the catalog JSON contract so the app can show media specs and
thumbnails:
- Add a top-level integer `schemaVersion` (1) to catalog.json and each
<category>.json.
- Emit a root-relative `thumbnailUrl` per item (same convention/`/Volts`
prefix as files[].downloadUrl) when front matter declares `thumbnail`,
else null. The raw `thumbnail` field is unchanged.
- Emit a best-effort, fully nullable `specs` object per item:
- lightshows: parse the .fseq header (PSEQ magic; channelCount,
frameCount, stepTime) -> channels + durationSeconds.
- locksounds/hornsounds/boombox/any .wav: RIFF chunk-walk for `fmt `
+ `data` -> channels, sampleRate, durationSeconds.
- mp3-only items: left null (VBR).
Every parser is wrapped in try/catch and tolerates the tiny placeholder
stub binaries (e.g. a 36-byte .fseq) without throwing.
Document the new fields in SCHEMA.md and keep the cross-repo invariants
accurate.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
What
Extends the catalog JSON contract (the feed
scripts/build.tsemits and the VOLTS app consumes) so the app can show media specs and thumbnails. Touchesscripts/build.tsandSCHEMA.mdonly.Changes
schemaVersion— new top-level integer (1) oncatalog.jsonand every<category>.json. Lets the app gate parsing of newer optional fields.thumbnailUrl— per item:<baseurl>/content/<category>/<slug>/<thumbnail>(root-relative, same/Voltsprefix convention asfiles[].downloadUrl) when front matter declaresthumbnail; otherwisenull. The rawthumbnailfield is kept as-is.specs— per item, best-effort and fully nullable{ channels, sampleRate, durationSeconds }:.fseqheader parse (PSEQmagic;channelCount@10,frameCount@14,stepTime@18) →channels,durationSeconds = frameCount*stepTime/1000..wav: RIFF chunk-walk forfmt(sampleRate, channels, bitsPerSample) +data(size) →sampleRate,durationSeconds = dataSize/(sampleRate*channels*bitsPerSample/8).null(VBR — not worth a header parse).Robustness
Every parser is wrapped in
try/catchand returnsnullon any failure. The committed fixtures are tiny placeholder stubs (e.g. a 36-byte.fseq) — these parse gracefully (degenerate values / nulls), never throw.Verification
npm run build→ exit 0; new fields present. Samples:.fseq):specs: { channels: 0, sampleRate: null, durationSeconds: 0.025 }.wav):specs: { channels: 1, sampleRate: 44100, durationSeconds: 5 }thumbnailUrl: "/Volts/content/wraps/cybertruck-camo/cybertruck-camo.png"npm run validate→ exit 0 (pre-existing placeholder-stub warnings only)._config.yml/_layouts/Liquid touched in this unit, so no Jekyll-side change to validate; the PR's build-check CI runsjekyll build.SCHEMA.md documents
schemaVersion,thumbnailUrl, andspecs(which categories populate which fields, all best-effort/nullable) and updates the cross-repo invariants.🤖 Generated with Claude Code