Files
ersatztv/ErsatzTV.Application/MediaCollections
timothy b0c1f8b51e fix(690,758): answer cold review — derive the population by shape, not by name
Round 1 of the cold adversarial review found no correctness defect in the six
handler fixes, and three real defects in what the change CLAIMED. Answering
them here rather than in the doc, per docs.no-session-narrative.

1. The record said the population was "eight `GetPaged*Handler` types, fully
   enumerated". That is a NAME-derived population — the exact method the record
   itself condemns two paragraphs earlier. Deriving it by SHAPE from the git
   index (CountAsync / .Skip( / TotalCount) finds three more count+page
   producers in ErsatzTV.Application/MediaCards with the same drift:
   GetTelevisionSeasonCards (counts ShowId == showId, pages every show sharing
   a Title+Year), GetTelevisionEpisodeCards and GetMusicVideoCards (count the
   item table, page the metadata table). All three are unreachable dead code
   left by blazor.ui-removed — zero call sites outside their own Queries folder
   — and page 1-based against api.paging-zero-based, so they are DEFERRED to
   #832 and recorded, not folded in. An unrecorded site reads as a clean tree.

2. docs/api-conventions.md was not updated. CLAUDE.md's docs table makes that a
   same-PR hard rule, and its "Paged GET with clamped params" exemplar is where
   a controller author actually looks. It now carries the count rule.

3. The `Channel != null` claim was a mechanism I did not measure. Playout.ChannelId
   is non-nullable with DeleteBehavior.Cascade and both production connection
   strings set foreign keys=true, so the orphan state is unreachable while the FK
   holds. The clause is defensive; the record no longer describes an inflated
   total anyone saw. Same correction for blast radius: only rerun-collections,
   multi-collections and playouts reach a controller — the other three had no
   production caller and were latent, not live.

Also: GetPagedFillerPresets and GetPagedTraktLists now derive count and page
from one query too. Their DbSet counts were not wrong (they take no Query
parameter), but leaving them counting one expression while paging another
preserves the drift for whoever adds the first filter — which is the argument
the record makes, so exempting them contradicted it.

And a test that pins the property the issues are actually about: pageSize 1
over 2 matching rows, asserting a real second page and an empty page past the
last match. Every previous case fit on one page, so none exercised the count
driving pagination at all.

refs #832
2026-08-26 08:23:07 +02:00
..