Skip to content

feat(demo,admin): pick assets from a dropdown fed by an optional mapper listing - #19

Closed
includeamin wants to merge 2 commits into
clipping-and-concatenationfrom
asset-dropdown
Closed

includeamin wants to merge 2 commits into
clipping-and-concatenationfrom
asset-dropdown

Conversation

@includeamin

Copy link
Copy Markdown
Owner

Stacked on #18 (clipping-and-concatenation). Merge #18 first; GitHub then retargets this PR to main.

What and why

With a mapper resolver, the demo and control panel could only offer assets that had already been played, because the server had no way to know the mapper's catalog. You had to know an asset's ID (such as the new preroll and trimmed examples) and type it.

  • Optional mapper endpoint GET /v1/assets: answers {"assets": [...]}. /admin/status passes the list on as resolver.known_assets, asking concurrently with the health check.
    • It is optional: a 404, a malformed body or an outage just means no list (null), so existing mappers are unaffected.
    • IDs a request could not name are dropped; the rest are deduplicated, sorted and capped at limits.max_assets. The response is size-bounded like any mapper answer.
    • Nothing is preloaded because it is listed; startup still preloads only the static catalog.
  • The example mapper implements it from catalog.json.
  • Demo and control panel: the asset field is now a dropdown of everything /admin/status names, ending with "Custom…", which reveals a text field for any other ID (Enter plays it). It replaces the demo's "Try:" row and the control panel's separate picker plus text box.
  • Docs: the mapper API reference (new "List assets" section), docs/operations.md and docs/usage.md.

How it was tested

  • Registry tests: the listing is sorted, deduplicated and filtered to valid IDs; a malformed listing is no listing; the list is capped at limits.max_assets. The existing test for a mapper without the endpoint still gets null.
  • Headless Chrome, both pages, against the example mapper: the dropdown lists all six catalog assets plus "Custom…". Picking preroll plays it past the clip boundary at 640×360. Choosing "Custom…" shows and focuses the name field, and typing trimmed + Enter requests and plays it.

Checklist

  • make ci passes
  • There is a test that fails without this change
  • Anything read from a file or a mapper is bounded before it is allocated
  • The handbook is updated if operators, mapper authors, or players see the change
  • Every commit is signed off (git commit -s): not signed off. This is a branch in this repository, which the DCO check exempts.
  • I did not copy or adapt code from a project with an incompatible licence (see CONTRIBUTING.md)

@includeamin

Copy link
Copy Markdown
Owner Author

Superseded by #24: its two commits (the optional mapper asset listing and the demo/admin asset dropdown) are included there, rebased onto main after #18 was merged.

@includeamin includeamin closed this Oct 1, 2026
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.

1 participant