Backend: GET /api/playouts (list) endpoint #100

Closed
opened 2026-07-02 19:44:02 +02:00 by timothy · 2 comments
Owner

From the ChicoryTV plan audit (epic #59, 2026-07-02).

The Playouts screen (#87) needs a playout list for its left rail, but REST only exposes GET /api/playouts/{id} (plus create-classic/delete). The internal GetPagedPlayouts query already returns id, channel number/name, scheduleKind/scheduleName with query + paging — it is only wired to Blazor (Playouts.razor).

Scope

  • Add GET /api/playouts?query=&pageNum=&pageSize= exposing GetPagedPlayouts.
  • Response DTO under ErsatzTV.Core/Api/Playouts/ (list item: id, channelNumber, channelName, scheduleKind, scheduleName, dailyRebuildTime).
  • Regenerate OpenAPI + SPA types.

Unblocks: #87 left rail + filter (rail search maps to the existing query param). Also feeds the Dashboard follow-up "Active playouts" tile.
Hard-blocks #87. Effort: S (pure REST wrapper over an existing query).

From the ChicoryTV plan audit (epic #59, 2026-07-02). The Playouts screen (#87) needs a playout list for its left rail, but REST only exposes `GET /api/playouts/{id}` (plus create-classic/delete). The internal `GetPagedPlayouts` query already returns id, channel number/name, scheduleKind/scheduleName with query + paging — it is only wired to Blazor (`Playouts.razor`). **Scope** - Add `GET /api/playouts?query=&pageNum=&pageSize=` exposing `GetPagedPlayouts`. - Response DTO under `ErsatzTV.Core/Api/Playouts/` (list item: id, channelNumber, channelName, scheduleKind, scheduleName, dailyRebuildTime). - Regenerate OpenAPI + SPA types. **Unblocks:** #87 left rail + filter (rail search maps to the existing `query` param). Also feeds the Dashboard follow-up "Active playouts" tile. **Hard-blocks #87.** Effort: S (pure REST wrapper over an existing query).
timothy added the enhancementapi labels 2026-07-02 19:44:02 +02:00
timothy added a new dependency 2026-07-02 19:44:15 +02:00
Author
Owner

Working on this via branch feat/playouts-read-api (covers #100 #101 #107 #110). Recon of the salvaged WIP commit 49a6d4ee: GET /api/playouts is implemented and correctly exposes the existing GetPagedPlayouts query with query/pageNum/pageSize params and a PagedPlayoutsResponseModel (totalCount + page). One compile error elsewhere in the WIP is being fixed; branch is being rebased onto main, then built/tested and the OpenAPI spec regenerated. PR to follow.

Working on this via branch `feat/playouts-read-api` (covers #100 #101 #107 #110). Recon of the salvaged WIP commit 49a6d4ee: GET /api/playouts is implemented and correctly exposes the existing GetPagedPlayouts query with query/pageNum/pageSize params and a PagedPlayoutsResponseModel (totalCount + page). One compile error elsewhere in the WIP is being fixed; branch is being rebased onto main, then built/tested and the OpenAPI spec regenerated. PR to follow.
Author
Owner

Closed via PR #116. GET /api/playouts exposes GetPagedPlayouts (query/pageNum/pageSize) returning PagedPlayoutsResponseModel { totalCount, page[] } with id, channelNumber/Name, scheduleKind/Name, dailyRebuildTime, nullable buildStatus. Files: PlayoutController.cs, PagedPlayoutsResponseModel.cs, PlayoutListItemResponseModel.cs, PlayoutControllerTests.cs, v1.json. Merged via PR #116 (commit 20ca71b3, squashed from salvaged WIP 49a6d4ee, rebased onto main). Build 0 errors; TZ=UTC tests 289/289 green; OpenAPI regenerated via scripts/update-openapi.sh. Adversarial (fable) review verdict FIX-FIRST → fixed before merge: DTO files lacked #nullable enable so the spec wrongly documented buildStatus/scheduleFile as non-nullable (would have broken SPA typegen). Deferred (backlog note, matches existing convention): pageSize is unclamped on paged endpoints. No doc updates needed beyond the regenerated spec; SPA type-regen happens when #59 branch syncs with main.

**Closed via PR #116.** GET /api/playouts exposes GetPagedPlayouts (query/pageNum/pageSize) returning PagedPlayoutsResponseModel { totalCount, page[] } with id, channelNumber/Name, scheduleKind/Name, dailyRebuildTime, nullable buildStatus. Files: PlayoutController.cs, PagedPlayoutsResponseModel.cs, PlayoutListItemResponseModel.cs, PlayoutControllerTests.cs, v1.json. Merged via PR #116 (commit 20ca71b3, squashed from salvaged WIP 49a6d4ee, rebased onto main). Build 0 errors; TZ=UTC tests 289/289 green; OpenAPI regenerated via scripts/update-openapi.sh. Adversarial (fable) review verdict FIX-FIRST → fixed before merge: DTO files lacked #nullable enable so the spec wrongly documented buildStatus/scheduleFile as non-nullable (would have broken SPA typegen). Deferred (backlog note, matches existing convention): pageSize is unclamped on paged endpoints. No doc updates needed beyond the regenerated spec; SPA type-regen happens when #59 branch syncs with main.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: timothy/ersatztv#100