Backend: library scan status/progress endpoint #106

Closed
opened 2026-07-02 19:44:03 +02:00 by timothy · 1 comment
Owner

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

Scan progress lives in-memory only in ScannerProxyService and reaches the Blazor UI via the LibraryScanProgress MediatR notification + SignalR. There is no REST surface, so the SPA Libraries screen (#88) cannot show the "Scanning 62%" bar or scanning/synced badges.

Scope

  • Expose ScannerProxyService.GetProgress via a REST poll endpoint (e.g. GET /api/libraries/scan-status returning active scans {libraryId, percent}), or SSE if polling proves clunky. Poll is fine for v1.
  • Regenerate OpenAPI + SPA types.

Hard-blocks the scan UI in #88 (the read model itself is a separate issue).
Effort: M (bridging in-memory state to REST).

From the ChicoryTV plan audit (epic #59, 2026-07-02). Scan progress lives **in-memory only** in `ScannerProxyService` and reaches the Blazor UI via the `LibraryScanProgress` MediatR notification + SignalR. There is no REST surface, so the SPA Libraries screen (#88) cannot show the "Scanning 62%" bar or scanning/synced badges. **Scope** - Expose `ScannerProxyService.GetProgress` via a REST poll endpoint (e.g. `GET /api/libraries/scan-status` returning active scans `{libraryId, percent}`), or SSE if polling proves clunky. Poll is fine for v1. - Regenerate OpenAPI + SPA types. **Hard-blocks the scan UI in #88** (the read model itself is a separate issue). Effort: M (bridging in-memory state to REST).
timothy added the enhancementapi labels 2026-07-02 19:44:03 +02:00
timothy added a new dependency 2026-07-02 19:44:16 +02:00
Author
Owner

Done

What was done: Opened PR #115 with GET /api/libraries/scan-status. The endpoint exposes active in-memory scanner progress from ScannerProxyService as a pollable list of { libraryId, percent } records for the SPA Libraries screen.

Root cause: n/a - feature gap; scan progress existed only in memory plus MediatR/Courier notifications for Blazor.

Files changed: IScannerProxyService/ScannerProxyService now expose active scans, new scan-status MediatR query/handler and DTO, LibrariesController GET route metadata, focused handler/controller tests, and regenerated ErsatzTV/wwwroot/openapi/v1.json.

Verification: dotnet build ErsatzTV.sln passed with existing NU1903 advisory warnings. TZ=UTC dotnet test ErsatzTV.Tests/ErsatzTV.Tests.csproj -v minimal passed: 285 passed, 0 failed. OpenAPI generation passed via dotnet build -t:GenerateOpenApiDocuments --no-restore -m:1 /nodeReuse:false; the plain script target hung once and was cancelled before the constrained equivalent completed.

Deferred: Issue closure is deferred until PR #115 is reviewed and merged; the PR body includes Fixes #106.

Follow-up issues: none.

Docs updated: OpenAPI v1.json regenerated; no separate docs changes needed.

## Done **What was done**: Opened PR #115 with `GET /api/libraries/scan-status`. The endpoint exposes active in-memory scanner progress from `ScannerProxyService` as a pollable list of `{ libraryId, percent }` records for the SPA Libraries screen. **Root cause**: n/a - feature gap; scan progress existed only in memory plus MediatR/Courier notifications for Blazor. **Files changed**: `IScannerProxyService`/`ScannerProxyService` now expose active scans, new scan-status MediatR query/handler and DTO, `LibrariesController` GET route metadata, focused handler/controller tests, and regenerated `ErsatzTV/wwwroot/openapi/v1.json`. **Verification**: `dotnet build ErsatzTV.sln` passed with existing NU1903 advisory warnings. `TZ=UTC dotnet test ErsatzTV.Tests/ErsatzTV.Tests.csproj -v minimal` passed: 285 passed, 0 failed. OpenAPI generation passed via `dotnet build -t:GenerateOpenApiDocuments --no-restore -m:1 /nodeReuse:false`; the plain script target hung once and was cancelled before the constrained equivalent completed. **Deferred**: Issue closure is deferred until PR #115 is reviewed and merged; the PR body includes `Fixes #106`. **Follow-up issues**: none. **Docs updated**: OpenAPI `v1.json` regenerated; no separate docs changes needed.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: timothy/ersatztv#106