An episode does not take from its series what upstream gives it #63

Closed
opened 2026-08-04 12:04:53 +02:00 by Claude · 1 comment
Collaborator

An episode does not take from its series what upstream gives it.

Two fields, one block of DtoService.AttachBasicFields, found by replaying the
committed scenarios against a production library.

PrimaryImageAspectRatio (DtoService.cs:1381): where an episode carries no
primary image of its own, upstream attaches the ratio measured from the
series' poster —

if (dto.ImageTags is null || !dto.ImageTags.ContainsKey(ImageType.Primary))
{
    AttachPrimaryImageAspectRatio(dto, episodeSeries);
}

so an episode with no artwork still reports 0.6666…, the 2:3 of the series
poster. This server reports nothing. Measured: 19 occurrences across
/Items/Latest, /Shows/NextUp and /UserItems/Resume. There is a second
call at :1454 for the other type that inherits this way.

AirTime (DtoService.cs:1423): dto.AirTime = series.AirTime,
unconditionally. This server never emits the field — it is not a BaseItems
column here, and upstream keeps it in the series' Data blob. Measured: 4
occurrences.

Both are pre-existing and neither is new. They became visible only once the
refusals fixed in #48 stopped aborting whole responses, so more of each body is
now compared: browsing reports more differences than before while every other
scenario reports far fewer.

Not reachable from the reference library, whose episodes all carry their own
artwork and whose series name no air time.

An episode does not take from its series what upstream gives it. Two fields, one block of `DtoService.AttachBasicFields`, found by replaying the committed scenarios against a production library. **`PrimaryImageAspectRatio`** (`DtoService.cs:1381`): where an episode carries no primary image of its own, upstream attaches the ratio measured from the *series'* poster — if (dto.ImageTags is null || !dto.ImageTags.ContainsKey(ImageType.Primary)) { AttachPrimaryImageAspectRatio(dto, episodeSeries); } so an episode with no artwork still reports `0.6666…`, the 2:3 of the series poster. This server reports nothing. Measured: 19 occurrences across `/Items/Latest`, `/Shows/NextUp` and `/UserItems/Resume`. There is a second call at `:1454` for the other type that inherits this way. **`AirTime`** (`DtoService.cs:1423`): `dto.AirTime = series.AirTime`, unconditionally. This server never emits the field — it is not a `BaseItems` column here, and upstream keeps it in the series' `Data` blob. Measured: 4 occurrences. Both are pre-existing and neither is new. They became visible only once the refusals fixed in #48 stopped aborting whole responses, so more of each body is now compared: `browsing` reports more differences than before while every other scenario reports far fewer. Not reachable from the reference library, whose episodes all carry their own artwork and whose series name no air time.
Author
Collaborator

Fixed, and the issue text was wrong on both halves.

PrimaryImageAspectRatio is inherited, but the rule covers seasons as
well as episodes
— the second call at DtoService.cs:1454 serves Season.
Both blocks sit under a commented-out ItemFields check, so neither is gated by
what the request asked for. Where the item's own ImageTags has no Primary,
the series' ratio is attached.

AirTime is not inherited at all. It sits inside if (item is Series tmp)
(DtoService.cs:1419) — a series' own field, which this port never emitted. All
four occurrences in the diff were on Series rows.

Measured against upstream, Fields=PrimaryImageAspectRatio&Limit=100:

route upstream before after
/Items/Latest 21 PAR / 15 AirTime 20 / 0 21 / 15
/Shows/NextUp 4 / 0 0 / 0 4 / 0
/UserItems/Resume 2 / 0 0 / 0 2 / 0

Per-id value comparison on all three: 16, 4 and 2 differing ids → 0, 0, 0.
Harness browsing 28 → 5.

Reading the stored image dimensions is enough: upstream's ImageProcessor
returns the stored width and height when both are positive and only opens the
file otherwise, and no row in the measured library has a non-positive dimension
or a remote path.

This exposed a deeper defect rather than hiding one — see #65, where a season
whose own poster went unreported borrowed its series' shape and reported a ratio
upstream does not send.

Fixed, and the issue text was wrong on both halves. **`PrimaryImageAspectRatio`** is inherited, but the rule covers **seasons as well as episodes** — the second call at `DtoService.cs:1454` serves `Season`. Both blocks sit under a commented-out `ItemFields` check, so neither is gated by what the request asked for. Where the item's own `ImageTags` has no `Primary`, the series' ratio is attached. **`AirTime` is not inherited at all.** It sits inside `if (item is Series tmp)` (`DtoService.cs:1419`) — a series' own field, which this port never emitted. All four occurrences in the diff were on `Series` rows. Measured against upstream, `Fields=PrimaryImageAspectRatio&Limit=100`: | route | upstream | before | after | |---|---|---|---| | `/Items/Latest` | 21 PAR / 15 AirTime | 20 / 0 | **21 / 15** | | `/Shows/NextUp` | 4 / 0 | 0 / 0 | **4 / 0** | | `/UserItems/Resume` | 2 / 0 | 0 / 0 | **2 / 0** | Per-id value comparison on all three: 16, 4 and 2 differing ids → **0, 0, 0**. Harness `browsing` 28 → 5. Reading the stored image dimensions is enough: upstream's `ImageProcessor` returns the stored width and height when both are positive and only opens the file otherwise, and no row in the measured library has a non-positive dimension or a remote path. This exposed a deeper defect rather than hiding one — see #65, where a season whose own poster went unreported borrowed its series' shape and reported a ratio upstream does not send.
Sign in to join this conversation.
No description provided.