feat(api): standardize FFmpeg profile endpoints #52

Merged
timothy merged 1 commits from issue38-rest-api-standardization into main 2026-06-30 07:42:06 +02:00
Owner

Summary

  • Retrofit FFmpeg profile API from verb-in-path routes to idiomatic REST routes under /api/ffmpeg/profiles[/{id}].
  • Add stable create/update request DTOs and return read-model bodies for create/update.
  • Use ApiResults/ProblemDetails error mapping for FFmpeg profile 404/422, including handler-level NotFoundError classification.
  • Apply API-key write protection to FFmpeg profiles and legacy mutating library/maintenance API endpoints; API-key failures now return ProblemDetails 401 bodies.
  • Regenerate OpenAPI and update REST API docs with CORS/sweep results and deferred legacy route reshaping.

Review Follow-up

Adversarial review found two issues before PR creation:

  • Legacy mutating /api/libraries/* and /api/maintenance/* endpoints were not covered by ApiKeyAuthorizationFilter; fixed with controller filters and regression tests.
  • FFmpeg profile mutation 401 responses were not documented; fixed runtime 401 to return ProblemDetails, added metadata/static OpenAPI tests, and regenerated OpenAPI.

Verification

  • LSP diagnostics on changed C# files: no diagnostics.
  • scripts/update-openapi.sh: succeeded.
  • dotnet build ErsatzTV.sln: succeeded, 0 warnings, 0 errors.
  • TZ=UTC dotnet test ErsatzTV.sln -v normal: succeeded, 263 passed, 0 failed.

Refs #38

## Summary - Retrofit FFmpeg profile API from verb-in-path routes to idiomatic REST routes under `/api/ffmpeg/profiles[/{id}]`. - Add stable create/update request DTOs and return read-model bodies for create/update. - Use `ApiResults`/`ProblemDetails` error mapping for FFmpeg profile 404/422, including handler-level `NotFoundError` classification. - Apply API-key write protection to FFmpeg profiles and legacy mutating library/maintenance API endpoints; API-key failures now return `ProblemDetails` 401 bodies. - Regenerate OpenAPI and update REST API docs with CORS/sweep results and deferred legacy route reshaping. ## Review Follow-up Adversarial review found two issues before PR creation: - Legacy mutating `/api/libraries/*` and `/api/maintenance/*` endpoints were not covered by `ApiKeyAuthorizationFilter`; fixed with controller filters and regression tests. - FFmpeg profile mutation 401 responses were not documented; fixed runtime 401 to return `ProblemDetails`, added metadata/static OpenAPI tests, and regenerated OpenAPI. ## Verification - LSP diagnostics on changed C# files: no diagnostics. - `scripts/update-openapi.sh`: succeeded. - `dotnet build ErsatzTV.sln`: succeeded, 0 warnings, 0 errors. - `TZ=UTC dotnet test ErsatzTV.sln -v normal`: succeeded, 263 passed, 0 failed. Refs #38
timothy added 1 commit 2026-06-30 07:30:29 +02:00
feat(api): standardize ffmpeg profile endpoints
Build ErsatzTV Image / Build & test (.NET) (pull_request) Successful in 5m12s
Build ErsatzTV Image / EF migration integrity (SQLite + MySql) (pull_request) Successful in 6m13s
Build ErsatzTV Image / Build & push image (amd64) (pull_request) Has been skipped
861827dcbc
refs #38
timothy merged commit 4aec234e20 into main 2026-06-30 07:42:06 +02:00
timothy deleted branch issue38-rest-api-standardization 2026-06-30 07:42:06 +02:00
Sign in to join this conversation.