CosplayersMissingCover stat is hardcoded to 0 — never wired up #97

Closed
opened 2026-07-12 15:44:47 +00:00 by Ai_Agent · 0 comments
Collaborator

The CosplayersMissingCover statistic on the Stats page is rendered in the UI (Stats.razor:48) and has a DTO property (StatsDto.cs:117), but the actual database computation was never implemented.

Current state

Layer Status
DTO (StatsDto.cs) Property CosplayersMissingCover exists — XML doc: "Not wired yet — reserved for future use."
UI (Stats.razor:48) Card renders _stats.CosplayersMissingCover
Repository (StatsRepository.cs:93) Hardcoded to dto.CosplayersMissingCover = 0

Fix

In Lactose/Repositories/StatsRepository.cs, replace line 93 with a query that counts people (cosplayers) who either have no albums, or whose albums all lack a CoverAssetId. Something like:

dto.CosplayersMissingCover = context.People
    .Count(p => p.Albums == null || !p.Albums.Any() || p.Albums.All(a => a.CoverAssetId == null));

This mirrors the existing AlbumsMissingCover logic (line 91) which counts albums where CoverAssetId == null.

The `CosplayersMissingCover` statistic on the Stats page is rendered in the UI (`Stats.razor:48`) and has a DTO property (`StatsDto.cs:117`), but the actual database computation was never implemented. ## Current state | Layer | Status | |---|---| | **DTO** (`StatsDto.cs`) | Property `CosplayersMissingCover` exists — XML doc: *"Not wired yet — reserved for future use."* | | **UI** (`Stats.razor:48`) | Card renders `_stats.CosplayersMissingCover` | | **Repository** (`StatsRepository.cs:93`) | Hardcoded to `dto.CosplayersMissingCover = 0` | ## Fix In `Lactose/Repositories/StatsRepository.cs`, replace line 93 with a query that counts people (cosplayers) who either have no albums, or whose albums all lack a `CoverAssetId`. Something like: ```csharp dto.CosplayersMissingCover = context.People .Count(p => p.Albums == null || !p.Albums.Any() || p.Albums.All(a => a.CoverAssetId == null)); ``` This mirrors the existing `AlbumsMissingCover` logic (line 91) which counts albums where `CoverAssetId == null`.
Ai_Agent added the AI Genbug labels 2026-07-12 15:44:52 +00:00
REDCODE added this to the v1.0 - Initial Release milestone 2026-07-12 15:46:16 +00:00
Ai_Agent added the area:backendpage:stats labels 2026-07-12 17:44:52 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: MilkyShots/MilkyShots#97