Fix #11: resolve recent TV rows to real tv_parent request ids #24

Merged
gronod merged 6 commits from bugfix/11-recent-tv-target into develop 2026-09-19 16:22:50 +01:00
6 Commits
Author SHA1 Message Date
gronod 5b1be698d6 Document recent TV identity resolution and add a live callable check
Build and publish / Test and build (darwin) (pull_request) Successful in 1m52s
Build and publish / Test and build (linux) (pull_request) Successful in 2m26s
Build and publish / Test and build (windows) (pull_request) Successful in 3m6s
Build and publish / Test and build (windows) (push) Successful in 3m5s
Build and publish / Test and build (darwin) (push) Successful in 1m48s
Build and publish / Test and build (linux) (push) Successful in 2m10s
Build and publish / Build and publish Docker image (pull_request) Successful in 1m52s
Build and publish / Build and publish Docker image (push) Successful in 2m2s
The schema contract claimed recent target.id is requestId for every
kind — upstream TV rows actually carry a child request id there. The
docs now describe the bounded parent-scan resolution, the
ombi_tv_child identifier, and the id-0-with-warning degradation. A
live test proves a recent tv_parent target is callable via get.
2026-09-19 16:20:03 +01:00
gronod d07ef4f818 Treat requestId 0 as absent in the TV details overlay gate
Upstream Search/tv/info responses send requestId 0 (not a missing
field) for shows without a linked request, so the #7 request-state
overlay never fired on live instances — requested shows reported
requested:false. Now that the parent scan decodes the real collection
wrapper, gating on requestId nil-or-0 lets the overlay actually run.
2026-09-19 16:19:02 +01:00
gronod ff18e60d5a Resolve discover requested-fallback TV rows to tv_parent targets
The recentlyRequested fallback emitted tv_child targets for TV rows
while the primary requested-browse path emits tv_parent — and a
tv_child target is a dead end for read_requests get/children. Resolve
the child request id to the parent via the same bounded scan so both
paths agree; rows that fail resolution keep the truthful tv_child
target.
2026-09-19 16:18:04 +01:00
gronod 0ce9e2626b Surface parent provider ids on tv_child projections
ChildRequests carries no top-level provider ids upstream — they live
on the embedded parentRequest navigation property — so children/list
items emitted empty identifiers. Read them from the embedded record;
the child target id itself stays the true child PK (provider-shaped
for first-request children by upstream design, and callable for
child-scoped operations). Mock child rows and the new
/Request/tv/{id}/child fixture now match the real wire shape.
2026-09-19 16:16:54 +01:00
gronod 40155b5981 Resolve recent TV rows to real tv_parent request ids
Closes #11. Ombi builds recentlyRequested TV rows from child requests,
so requestId is a child id — and upstream persists the provider id as
the child PK for new-request children, so the value is provider-shaped
(TVDB/TMDB) while the parent request id never appears in the payload.
Consumers following target into read_requests get hit upstream 500s.

TV rows now resolve through one bounded v1 parent scan: an exact
child-id match against embedded childRequests (authoritative), then a
provider-id fallback against tvDbId/externalProviderId covering
versions that put the provider id in requestId directly. The child id
is preserved as an ombi_tv_child identifier, provider ids land under
tvdb/tmdb/imdb, and unresolvable rows emit target.id 0 with a warning
rather than a fabricated or provider-shaped target.
2026-09-19 16:15:18 +01:00
gronod 012f6c0852 Decode the v1 TV parent list's RequestsViewModel wrapper
Live Ombi serves GET /api/v1/Request/tv/{count}/{pos}/1/0/0 as
{"collection":[...],"total":N}, not a bare array, so decodeArray made
every bounded parent scan fail on real instances — the #7 details
overlay and the #10 search fallback only worked against the mock's
unrealistic bare-array fixture. Decode the documented wrapper shape
(tolerating bare arrays) and fix the mock to serve the real shape so
tests exercise what production sees.
2026-09-19 16:04:33 +01:00