feat(web+api): decos + deco groups, playout default deco, playlist/search pickers (#144 S3, #162) #174

Merged
timothy merged 4 commits from feat/144-s3-decos into main 2026-07-07 19:42:31 +02:00
Owner

Slice S3 of the #162 scheduling REST plan (parity issue #144): the big one — Decos.

API

  • New DecoController: GET/POST/DELETE /api/decos/groups[/{id}] (cascade), GET /api/decos (flat list, no placeholder rows), GET/POST/DELETE /api/decos[/{id}], PUT /api/decos/{id} full-state update (UpdateDeco returns Unit → re-GET pattern; clean 404 on concurrent delete).
  • Request-level Merge validation: Merge rejected (422) for break-content/default-filler/dead-air modes, allowed for watermark/graphics — the handler otherwise silently misbehaves.
  • PUT /api/playouts/{id}/deco — set/clear playout default deco (404 playout / 422 deco). Read-side (decoId on PlayoutResponseModel + SPA affordance) deliberately deferred to S6's playout editors.
  • New GET-only PlaylistController (/api/playlists/groups, /api/playlists?playlistGroupId=) — list wrappers only; CRUD stays with #151–#153. GET /api/search/{artists,multi-collections} wrappers added.
  • Root-cause fixes: CreateDecoHandler group-existence validation (same latent FK-500 class as S1/S2); UpdateDecoHandler now persists MediaItemId on break-content update/add paths (upstream bug: TelevisionShow/Season/Artist break content validated then silently persisted corrupt with null MediaItemId).

SPA

  • /app/decos list + /app/decos/{id} editor with all 6 Blazor sections: mode-gated Watermark/Graphics (Merge shown, "Replace" label for Override), Break Content (Override-only, placement-unique rows, playlist group→playlist cascade, legacy non-playlist items render read-only and round-trip verbatim), Default Filler (6-kind typeahead + trim-to-fit), Dead Air Fallback. Full-state PUT.
  • New decos.ts/playlists.ts api modules + tests.

Verification

  • ErsatzTV.Tests 720 green; Core.Tests 493 green; web 270 green; lint/tsc/build clean.
  • Live E2E: full API matrix (mode 422s, cascade, default-deco set/clear, playlist/search endpoints) + browser (all 6 sections, mode gating, placement exclusion, save/reload persistence, deletes). Deep-FK garbage ids still 500 with clean rollback — precedent-consistent, tracked in #172 item 4.
  • Adversarial review: no must-fix; the MediaItemId should-fix applied. Follow-ups noted in #172.

Part of #144 / #162 (slice S3 — do not auto-close).

🤖 Generated with Claude Code

Slice S3 of the #162 scheduling REST plan (parity issue #144): the big one — Decos. **API** - New `DecoController`: `GET/POST/DELETE /api/decos/groups[/{id}]` (cascade), `GET /api/decos` (flat list, no placeholder rows), `GET/POST/DELETE /api/decos[/{id}]`, `PUT /api/decos/{id}` full-state update (UpdateDeco returns Unit → re-GET pattern; clean 404 on concurrent delete). - Request-level Merge validation: `Merge` rejected (422) for break-content/default-filler/dead-air modes, allowed for watermark/graphics — the handler otherwise silently misbehaves. - `PUT /api/playouts/{id}/deco` — set/clear playout default deco (404 playout / 422 deco). Read-side (decoId on PlayoutResponseModel + SPA affordance) deliberately deferred to S6's playout editors. - New GET-only `PlaylistController` (`/api/playlists/groups`, `/api/playlists?playlistGroupId=`) — list wrappers only; CRUD stays with #151–#153. `GET /api/search/{artists,multi-collections}` wrappers added. - Root-cause fixes: `CreateDecoHandler` group-existence validation (same latent FK-500 class as S1/S2); `UpdateDecoHandler` now persists `MediaItemId` on break-content update/add paths (upstream bug: TelevisionShow/Season/Artist break content validated then silently persisted corrupt with null MediaItemId). **SPA** - `/app/decos` list + `/app/decos/{id}` editor with all 6 Blazor sections: mode-gated Watermark/Graphics (Merge shown, "Replace" label for Override), Break Content (Override-only, placement-unique rows, playlist group→playlist cascade, legacy non-playlist items render read-only and round-trip verbatim), Default Filler (6-kind typeahead + trim-to-fit), Dead Air Fallback. Full-state PUT. - New `decos.ts`/`playlists.ts` api modules + tests. **Verification** - ErsatzTV.Tests 720 green; Core.Tests 493 green; web 270 green; lint/tsc/build clean. - Live E2E: full API matrix (mode 422s, cascade, default-deco set/clear, playlist/search endpoints) + browser (all 6 sections, mode gating, placement exclusion, save/reload persistence, deletes). Deep-FK garbage ids still 500 with clean rollback — precedent-consistent, tracked in #172 item 4. - Adversarial review: no must-fix; the MediaItemId should-fix applied. Follow-ups noted in #172. Part of #144 / #162 (slice S3 — do not auto-close). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
timothy added 4 commits 2026-07-07 19:36:58 +02:00
Adds DecoController (groups + decos CRUD + full-state PUT), playlist and
artist/multi-collection search picker wrappers, a PlaylistController for the
break-content playlist cascade, and PUT /api/playouts/{id}/deco. Fixes the
CreateDecoHandler missing deco-group existence check (FK 500 -> 422), matching
the CreateBlock/CreateTemplate precedent. ReplaceDecoRequest.ToCommand rejects
Merge on the non-mergeable sections (422).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Adds the /app/decos screen (dual-mode list/editor) mirroring the legacy Blazor
deco form: deco/watermark/graphics/break-content/default-filler/dead-air
sections with mode-gated controls, watermark/graphics multi-selects, break
content with a playlist group->playlist cascade and per-placement uniqueness,
and default-filler/dead-air typeahead pickers. Adds decos/playlists api modules,
artist/multi-collection search wrappers, and regenerated types.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
fix(app): persist MediaItemId on deco break-content updates and adds (#144 S3 review)
Build ErsatzTV Image / Build & test (.NET) (pull_request) Successful in 4m26s
Build ErsatzTV Image / EF migration integrity (SQLite + MySql) (pull_request) Successful in 4m28s
Build ErsatzTV Image / Build & push image (amd64) (pull_request) Has been skipped
d71a609b4f
UpdateDecoHandler copied every break-content field except MediaItemId,
so TelevisionShow/Season/Artist break content validated then persisted
with a null MediaItemId (upstream bug surfaced by the new REST API).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
timothy merged commit 0c355e1132 into main 2026-07-07 19:42:31 +02:00
timothy deleted branch feat/144-s3-decos 2026-07-07 19:42:31 +02:00
Sign in to join this conversation.