Skip to content

Fix re-grab lifecycle: resolve on import, blocklist bad release, sync cards - #19

Merged
vancityactivist merged 1 commit into
mainfrom
dev
Jul 29, 2026
Merged

vancityactivist merged 1 commit into
mainfrom
dev

Conversation

@vancityactivist

Copy link
Copy Markdown
Owner

Summary

Fixes the issue-handling / re-grab workflow gaps where a Re-grab click could "resolve" an issue that wasn't actually fixed, re-download the same bad release, or queue duplicate downloads.

  • Resolve on import, not grab — a grab now records an in-flight re-grab (regrab_state) and the issue stays open. The notification poller watches the arr queue: on import it resolves the issue in Seerr and DMs the reporter; if the download leaves the queue without importing it flags the failure and re-broadcasts actionable cards to the handlers.
  • Blocklist the bad release — the release that produced the reported file is excluded from the re-search and marked failed (blocklisted) after the replacement grab, so the identical release can't be re-grabbed. Blocklisting is ordered after the grab so the arr's own redownload-on-failure search sees the queued replacement instead of double-grabbing.
  • Skip season packs for single-episode fixes — grabbing a whole season to fix one episode re-downloaded everything and left same-quality duplicates unimported.
  • Double-fire guards + card sync — every broadcast copy of an issue card (each handler DM + the channel post) is tracked in a new issue_messages table; outcomes are synced onto all copies and stale buttons are stripped. Re-grab/Resolve refuse when the issue is already resolved or a re-grab is in flight (with a 6h staleness escape hatch for stuck downloads). The dashboard's re-grab/resolve actions use the same lifecycle.
  • New admin settingSettings → General → Bot behaviour: "Allow users to request 'All seasons' of a show". When off, the TV season picker drops the All-seasons option and users must pick individual seasons (for servers with strict season quotas). Persisted across restarts.

New tracked_issues columns and the issue_messages table are applied via the existing idempotent migration path — no manual DB steps.

Test plan

  • 190 tests pass (19 new): release exclusion + blocklist ordering, season-pack filtering, grab-without-resolve, import/failure poller paths, double-fire guards, card-copy tracking + sync, store migrations, settings toggle, season picker without "All seasons"

🤖 Generated with Claude Code

… cards

Re-grab previously resolved the issue the moment a release was pushed to
the download client, often re-grabbed the identical bad release, and every
admin's copy of the issue card kept live buttons — letting a second click
queue a duplicate download.

- Exclude the previously grabbed release from the re-search and mark it
  failed (blocklisted) after the replacement grab; skip season packs when
  fixing a single episode
- Keep the issue open until the replacement actually imports: the poller
  watches the arr queue, resolves + DMs the reporter on import, and
  reopens the cards with a warning if the download dies
- Guard against double-fires (already resolved / re-grab in flight) and
  sync outcomes onto every broadcast copy of the card (new issue_messages
  table); dashboard re-grab and resolve use the same lifecycle
- Add a dashboard toggle to disable the "All seasons" option in the TV
  season picker, for servers with strict season quotas (persisted)

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@vancityactivist
vancityactivist merged commit eaf1a99 into main Jul 29, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant