Adds GET /api/media-sources for grouped media sources with child libraries, lastScan, and per-library item counts from a single grouped aggregate query.
Includes connected media sources even when they currently have zero qualifying/synced libraries, so #88 can render an empty source card.
Adds GET /api/libraries/scan-status to expose active in-memory scanner progress for SPA polling.
Adds focused NUnit/Shouldly/NSubstitute coverage for controller route metadata, MediatR pass-through, scan status mapping, the DB-backed media source read model, empty-source cards, and lastScan projection.
Rebases onto current main after PR #116 and regenerates ErsatzTV/wwwroot/openapi/v1.json in a separate commit.
dotnet build -t:GenerateOpenApiDocuments --no-restore -m:1 /nodeReuse:false passed and regenerated OpenAPI. The plain ./scripts/update-openapi.sh target previously hung in dotnet build -t:GenerateOpenApiDocuments; the constrained equivalent target completed successfully.
## Summary
- Adds `GET /api/media-sources` for grouped media sources with child libraries, `lastScan`, and per-library item counts from a single grouped aggregate query.
- Includes connected media sources even when they currently have zero qualifying/synced libraries, so #88 can render an empty source card.
- Adds `GET /api/libraries/scan-status` to expose active in-memory scanner progress for SPA polling.
- Adds focused NUnit/Shouldly/NSubstitute coverage for controller route metadata, MediatR pass-through, scan status mapping, the DB-backed media source read model, empty-source cards, and `lastScan` projection.
- Rebases onto current `main` after PR #116 and regenerates `ErsatzTV/wwwroot/openapi/v1.json` in a separate commit.
Fixes #103.
Fixes #106.
## Verification
- `dotnet build ErsatzTV.sln` passed with existing NU1903 advisory warnings.
- `TZ=UTC dotnet test ErsatzTV.Tests/ErsatzTV.Tests.csproj -v minimal` passed: 296 passed, 0 failed.
- `dotnet build -t:GenerateOpenApiDocuments --no-restore -m:1 /nodeReuse:false` passed and regenerated OpenAPI. The plain `./scripts/update-openapi.sh` target previously hung in `dotnet build -t:GenerateOpenApiDocuments`; the constrained equivalent target completed successfully.
Review follow-up applied:
- Rebased PR #115 onto current `main` after PR #116.
- Re-ran OpenAPI generation on the rebased tree.
- Addressed MINOR-1 by returning connected media sources even when none of their libraries qualify, so the response can render an empty source card.
- Addressed NIT-1 by asserting `lastScan` projection in the DB-backed handler test.
- Left `kind` as a string for this PR; changing it to a DTO enum is a contract decision better made with the SPA type consumer.
Fresh local verification:
- `dotnet build ErsatzTV.sln` passed with existing NU1903 warnings.
- `TZ=UTC dotnet test ErsatzTV.Tests/ErsatzTV.Tests.csproj -v minimal` passed: 296 passed, 0 failed.
timothy
merged commit b9955f4cba into main2026-07-03 23:10:38 +02:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Summary
GET /api/media-sourcesfor grouped media sources with child libraries,lastScan, and per-library item counts from a single grouped aggregate query.GET /api/libraries/scan-statusto expose active in-memory scanner progress for SPA polling.lastScanprojection.mainafter PR #116 and regeneratesErsatzTV/wwwroot/openapi/v1.jsonin a separate commit.Fixes #103.
Fixes #106.
Verification
dotnet build ErsatzTV.slnpassed with existing NU1903 advisory warnings.TZ=UTC dotnet test ErsatzTV.Tests/ErsatzTV.Tests.csproj -v minimalpassed: 296 passed, 0 failed.dotnet build -t:GenerateOpenApiDocuments --no-restore -m:1 /nodeReuse:falsepassed and regenerated OpenAPI. The plain./scripts/update-openapi.shtarget previously hung indotnet build -t:GenerateOpenApiDocuments; the constrained equivalent target completed successfully.bd8e54ae2dto69486ab2d6Review follow-up applied:
mainafter PR #116.lastScanprojection in the DB-backed handler test.kindas a string for this PR; changing it to a DTO enum is a contract decision better made with the SPA type consumer.Fresh local verification:
dotnet build ErsatzTV.slnpassed with existing NU1903 warnings.TZ=UTC dotnet test ErsatzTV.Tests/ErsatzTV.Tests.csproj -v minimalpassed: 296 passed, 0 failed.