feat(api): add collections REST endpoints #45

Merged
timothy merged 3 commits from feature/35-rest-api-collections into main 2026-06-28 09:37:13 +02:00
Owner

Closes #35

Summary

  • Add idiomatic REST Collections CRUD endpoints plus collection item add/remove routes.
  • Retrofit SmartCollectionController to REST-style routes and class-level API key authorization.
  • Preserve NotFoundError from collection/smart-collection handlers so ApiResults maps missing entities to 404 instead of 422.
  • Validate collection item mutations so invalid add requests return 422 and missing item associations return 404.
  • Stabilize culture-sensitive CustomStreamSelectorTests by pinning Sunday-first expectations to en-US and adding Monday-first coverage.

Tests

  • dotnet restore ErsatzTV.sln --disable-parallel -v normal
  • dotnet build ErsatzTV.sln -v normal
  • TZ=UTC dotnet test ErsatzTV.sln -v normal

Review Notes

  • Addressed adversarial review findings around POST /api/collections/{id}/items invalid IDs and DELETE /api/collections/{id}/items/{mediaItemId} missing associations.
  • No docs changes needed beyond the existing REST design; implementation follows the #2a controller/API conventions.
Closes #35 ## Summary - Add idiomatic REST Collections CRUD endpoints plus collection item add/remove routes. - Retrofit `SmartCollectionController` to REST-style routes and class-level API key authorization. - Preserve `NotFoundError` from collection/smart-collection handlers so `ApiResults` maps missing entities to 404 instead of 422. - Validate collection item mutations so invalid add requests return 422 and missing item associations return 404. - Stabilize culture-sensitive `CustomStreamSelectorTests` by pinning Sunday-first expectations to `en-US` and adding Monday-first coverage. ## Tests - `dotnet restore ErsatzTV.sln --disable-parallel -v normal` - `dotnet build ErsatzTV.sln -v normal` - `TZ=UTC dotnet test ErsatzTV.sln -v normal` ## Review Notes - Addressed adversarial review findings around `POST /api/collections/{id}/items` invalid IDs and `DELETE /api/collections/{id}/items/{mediaItemId}` missing associations. - No docs changes needed beyond the existing REST design; implementation follows the #2a controller/API conventions.
timothy added 1 commit 2026-06-27 21:44:03 +02:00
feat(api): add collections REST endpoints
Build ErsatzTV Image / Build & test (.NET) (pull_request) Successful in 4m5s
Build ErsatzTV Image / EF migration integrity (SQLite + MySql) (pull_request) Successful in 5m9s
Build ErsatzTV Image / Build & push image (amd64) (pull_request) Has been skipped
fb3f2856da
Refs #35
timothy added 1 commit 2026-06-28 08:57:58 +02:00
docs(api): refresh OpenAPI for collections REST
Build ErsatzTV Image / Build & test (.NET) (pull_request) Successful in 6m22s
Build ErsatzTV Image / EF migration integrity (SQLite + MySql) (pull_request) Successful in 7m54s
Build ErsatzTV Image / Build & push image (amd64) (pull_request) Has been skipped
2f306ce59f
Refs #35
timothy added 1 commit 2026-06-28 09:04:06 +02:00
docs(api): document collection REST response codes
Build ErsatzTV Image / Build & test (.NET) (pull_request) Successful in 3m39s
Build ErsatzTV Image / EF migration integrity (SQLite + MySql) (pull_request) Successful in 4m33s
Build ErsatzTV Image / Build & push image (amd64) (pull_request) Has been skipped
82f3a1e633
Refs #35
timothy merged commit 7c646a6829 into main 2026-06-28 09:37:13 +02:00
Sign in to join this conversation.