The attention queue flags a season on one failed grab #226

Closed
opened 2026-08-25 08:09:55 +01:00 by naps62-yolo · 1 comment
Owner

The TV attention queue flags a season on one failed grab and never lets go,
so it fills with seasons that need nothing and buries the ones that do.

tv_attention in crates/arr-api/src/movies.rs runs two branches. The episode
branch enforces §5.2's rule:

HAVING count(DISTINCT g.release_id) >= 2

The season branch does not:

FROM   grabs g
JOIN   seasons se ON g.target_kind = 'season' AND se.id = g.target_id
JOIN   series s ON s.id = se.series_id
WHERE  g.state = 'failed'
GROUP BY s.id, s.tmdb_id, s.title, s.year, se.id, se.number

Any season with a single failed grab, of any age, is listed. §5.2 is explicit
about the bar:

NEEDS DECISION holds titles that hard-failed twice on different releases.

Observed in production. GET /api/queues/attention returns Rick and Morty
with seasons: [1,2,3,4,5,6,7,8,9] — every season the series has. Season 8 has
two genuine pack failures and is the one that wants attention; the other eight
are there on old single failures and drown it. The operator went looking in
Transmission to find out what happened to season 8, because the queue that
exists to tell them was indistinguishable from noise.

Bring the season branch up to the episode branch's bar: require two failed
grabs on distinct releases.

Then decide whether a failure should age out, and say so in §5.2 either way.
The queue is meant to be visited and emptied — "the operator visits to confirm
nothing needs them" (§9.2 header notes) — but nothing ever leaves it today,
because a grabs row with state = 'failed' is permanent. #181 gave the pack
guard a backoff curve for exactly this reason; the queue has the same problem
and no equivalent. Whatever is chosen, a season the operator has dealt with must
be able to leave.

Non-goals: the episode branch is correct and is not being changed. This is not
about whether the failures were justified — season 8's two failures were real.

The TV attention queue flags a season on **one** failed grab and never lets go, so it fills with seasons that need nothing and buries the ones that do. `tv_attention` in `crates/arr-api/src/movies.rs` runs two branches. The episode branch enforces §5.2's rule: ```sql HAVING count(DISTINCT g.release_id) >= 2 ``` The season branch does not: ```sql FROM grabs g JOIN seasons se ON g.target_kind = 'season' AND se.id = g.target_id JOIN series s ON s.id = se.series_id WHERE g.state = 'failed' GROUP BY s.id, s.tmdb_id, s.title, s.year, se.id, se.number ``` Any season with a single failed grab, of any age, is listed. §5.2 is explicit about the bar: > NEEDS DECISION holds titles that hard-failed twice on different releases. **Observed in production.** `GET /api/queues/attention` returns Rick and Morty with `seasons: [1,2,3,4,5,6,7,8,9]` — every season the series has. Season 8 has two genuine pack failures and is the one that wants attention; the other eight are there on old single failures and drown it. The operator went looking in Transmission to find out what happened to season 8, because the queue that exists to tell them was indistinguishable from noise. Bring the season branch up to the episode branch's bar: require two failed grabs on distinct releases. Then decide whether a failure should age out, and say so in §5.2 either way. The queue is meant to be visited and emptied — "the operator visits to confirm nothing needs them" (§9.2 header notes) — but nothing ever leaves it today, because a `grabs` row with `state = 'failed'` is permanent. #181 gave the pack guard a backoff curve for exactly this reason; the queue has the same problem and no equivalent. Whatever is chosen, a season the operator has dealt with must be able to leave. Non-goals: the episode branch is correct and is not being changed. This is not about whether the failures were justified — season 8's two failures were real.
naps62-yolo added the area/apidifficulty/moderatetype/bug labels 2026-08-25 08:09:55 +01:00
naps62-yolo added a new dependency 2026-08-25 08:09:55 +01:00
naps62-yolo added this to the Feedback pass 2 milestone 2026-08-25 08:17:44 +01:00
Author
Owner

Two things found while implementing this, neither fixed here.

The section numbers in the issue do not match DESIGN.md on blitz/feedback-2. §5.2 is Language; the document ends at §14. The "NEEDS DECISION holds titles that hard-failed twice on different releases" sentence the issue quotes is in §9.5 (Notifications), and the hard-fail semantics live in §5.7. I put the new rule in §5.7 and left §9.5 alone, since a TV ageing rule inside the language policy section would be wrong. If the intended numbering comes from a version of the document I do not have, the rule needs moving.

The API and daemon disagree about whether a satisfied episode still queues. arr-daemon/src/attention.rs filters the episode hard-fail branch on e.wanted = 1 AND e.state != 'available'; the same branch in arr-api/src/movies.rs does not. So an episode imported from a third release stops notifying but keeps showing in GET /api/queues/attention. The movie lanes have the same split. Out of scope here — the issue names the episode branch a non-goal — but it is a real inconsistency and worth its own issue.

Two things found while implementing this, neither fixed here. **The section numbers in the issue do not match `DESIGN.md` on `blitz/feedback-2`.** §5.2 is *Language*; the document ends at §14. The "NEEDS DECISION holds titles that hard-failed twice on different releases" sentence the issue quotes is in §9.5 (Notifications), and the hard-fail semantics live in §5.7. I put the new rule in §5.7 and left §9.5 alone, since a TV ageing rule inside the language policy section would be wrong. If the intended numbering comes from a version of the document I do not have, the rule needs moving. **The API and daemon disagree about whether a satisfied episode still queues.** `arr-daemon/src/attention.rs` filters the episode hard-fail branch on `e.wanted = 1 AND e.state != 'available'`; the same branch in `arr-api/src/movies.rs` does not. So an episode imported from a third release stops notifying but keeps showing in `GET /api/queues/attention`. The movie lanes have the same split. Out of scope here — the issue names the episode branch a non-goal — but it is a real inconsistency and worth its own issue.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: yolo/arr#226