feat(api): REST CRUD for multi-collections and rerun-collections (#151, #152) #188

Merged
timothy merged 4 commits from feat/multi-rerun-collections-api into main 2026-07-08 18:54:36 +02:00
Owner

Backend REST API for multi-collections (#151) and rerun-collections (#152) over the existing MediatR handlers. API-only — SPA editor screens are a follow-up (thin api-client modules added so they're unblocked).

  • MultiCollectionController + RerunCollectionController: list (paged, clamped) / get / create / update / delete, following the CollectionController/SmartCollectionController pattern (ApiResults, 404 pre-checks, #nullable enable DTOs, [EndpointGroupName], full [ProducesResponseType]).
  • Response DTOs flatten the Application VMs; CollectionType/PlaybackOrder exposed as string-enums via the global converter (matches BlockItemResponseModel precedent).
  • Rerun request DTO takes CollectionType + a single SelectedId; ToCommand() builds a minimal id-only VM — confirmed the handlers read only .Id/.MediaItemId, so no extra lookups (documented inline in RerunCollectionRequestMapping.cs).
  • Controller + contract tests added; OpenAPI + TS types regenerated (4 new paths, 10 new schemas, zero removed; docs/endpoint-index.md auto-regenerated). Thin web/src/api/multiCollections.ts + rerunCollections.ts.
  • docs/blazor-route-parity.md updated (API done; SPA editor pending).

Verified pre-merge-of-main: ErsatzTV.Tests 863 green, web typecheck+lint+build+vitest 330 green. origin/main (#187 assembly-scan) merged in cleanly — the two new controllers are auto-covered by the security scan.

Refs #151, #152 (kept open until the SPA editors land).

🤖 Generated with Claude Code

Backend REST API for multi-collections (#151) and rerun-collections (#152) over the existing MediatR handlers. **API-only** — SPA editor screens are a follow-up (thin api-client modules added so they're unblocked). - `MultiCollectionController` + `RerunCollectionController`: list (paged, clamped) / get / create / update / delete, following the CollectionController/SmartCollectionController pattern (ApiResults, 404 pre-checks, `#nullable enable` DTOs, [EndpointGroupName], full [ProducesResponseType]). - Response DTOs flatten the Application VMs; `CollectionType`/`PlaybackOrder` exposed as string-enums via the global converter (matches `BlockItemResponseModel` precedent). - **Rerun request DTO** takes `CollectionType` + a single `SelectedId`; `ToCommand()` builds a minimal id-only VM — confirmed the handlers read only `.Id`/`.MediaItemId`, so no extra lookups (documented inline in `RerunCollectionRequestMapping.cs`). - Controller + contract tests added; OpenAPI + TS types regenerated (4 new paths, 10 new schemas, zero removed; `docs/endpoint-index.md` auto-regenerated). Thin `web/src/api/multiCollections.ts` + `rerunCollections.ts`. - `docs/blazor-route-parity.md` updated (API done; SPA editor pending). Verified pre-merge-of-main: `ErsatzTV.Tests` 863 green, web typecheck+lint+build+vitest 330 green. origin/main (#187 assembly-scan) merged in cleanly — the two new controllers are auto-covered by the security scan. Refs #151, #152 (kept open until the SPA editors land). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
timothy added 2 commits 2026-07-08 18:20:10 +02:00
Adds MultiCollectionController + RerunCollectionController (list/get/create/update/
delete) over the existing MediatR handlers, with response/request DTOs, controller +
contract tests, regenerated OpenAPI + TS types, and thin SPA api-client modules. SPA
editor screens are a follow-up. Rerun request DTO resolves the chosen entity id into
the minimal VM the handler reads (documented inline).

Refs #151, #152

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Merge remote-tracking branch 'origin/main' into feat/multi-rerun-collections-api
Build ErsatzTV Image / Build & test (.NET) (pull_request) Successful in 4m32s
Build ErsatzTV Image / EF migration integrity (SQLite + MySql) (pull_request) Successful in 4m37s
Build ErsatzTV Image / Build & push image (amd64) (pull_request) Has been skipped
16c8789638
timothy added 1 commit 2026-07-08 18:30:09 +02:00
fix(api): reject unsupported CollectionType on rerun-collection create/update (#152 review)
Build ErsatzTV Image / Build & test (.NET) (pull_request) Successful in 4m25s
Build ErsatzTV Image / EF migration integrity (SQLite + MySql) (pull_request) Successful in 4m42s
Build ErsatzTV Image / Build & push image (amd64) (pull_request) Has been skipped
dc459c6cd5
The rerun request mapping's catch-all routed Playlist/RerunFirstRun/RerunRerun/
SearchQuery/Fake* to MediaItemId, so POST/PUT with those persisted a wrong-kind id
and returned 201 instead of 422. Guard both verbs with IsSupportedSelectionType.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
timothy added 1 commit 2026-07-08 18:44:29 +02:00
Merge remote-tracking branch 'origin/main' into feat/multi-rerun-collections-api
Build ErsatzTV Image / Build & test (.NET) (pull_request) Successful in 4m15s
Build ErsatzTV Image / EF migration integrity (SQLite + MySql) (pull_request) Successful in 3m51s
Build ErsatzTV Image / Build & push image (amd64) (pull_request) Has been skipped
282f59ea60
# Conflicts:
#	docs/blazor-route-parity.md
#	docs/endpoint-index.md
timothy merged commit 1c035cc94f into main 2026-07-08 18:54:36 +02:00
Sign in to join this conversation.