Skip to content

fix(requests): preserve TV requests on lookup failures - #262

Merged
snapetech merged 1 commit into
mainfrom
codex/upstream-tvdb-request-recovery-20261013
Oct 15, 2026
Merged

snapetech merged 1 commit into
mainfrom
codex/upstream-tvdb-request-recovery-20261013

Conversation

@snapetech

@snapetech snapetech commented Oct 13, 2026 •

Copy link
Copy Markdown
Collaborator

Description

TV requests can fail when TMDB has no TVDB identifier and Sonarr requires one. The old dispatch path removed both the media row and request before the normal failure handler could retain them. This change checks TVDB's TMDB remote-ID records, then the selected Sonarr server's TMDB lookup, and keeps unresolved requests visible as failed.

For IDs resolved outside TMDB, requested regular-season numbers are checked against official TVDB season data before dispatch. Missing or mismatched season data fails safely, while specials remain eligible. Fallback IDs are used for dispatch only and are not written to SeerrNG's uniquely constrained shared TVDB field.

This work is informed by Seerr issue #3488, PR #3489, and PR #3490. The implementation follows SeerrNG's existing TVDB provider, Servarr response sanitization, request lifecycle, and shared-media identity constraints. Alternate season-number mapping remains separate work.

Codex assisted with investigation, implementation, and tests; the maintainer reviewed the resulting changes.

How Has This Been Tested?

  • pnpm test:node server/api/servarr/sonarr.test.ts server/api/tvdb/videoMetadata.test.ts server/test/MediaRequestSubscriber.test.ts — 67 passed, 0 failed.
  • pnpm typecheck:server — passed.
  • Focused ESLint, Oxlint, Prettier, and git diff --check — passed.
  • pnpm release-notes:preview --base origin/main --head HEAD — includes the new Requests fix note.
  • Full hosted Mode 2 validation is pending. No live TVDB or Sonarr round-trip was run.

Screenshots / Logs (if applicable)

No UI changes.

Release Notes

  • I added release-notes/tvdb-request-recovery.md.
  • This change is internal-only and does not need a user-facing release note.
  • The fragment includes audience, area, action, and breaking-change status.
  • I previewed the release text with pnpm release-notes:preview.

Checklist:

  • I have read and followed the contribution guidelines.
  • Disclosed use of AI (see the AI assistance policy).
  • I have updated the documentation accordingly.
  • All new and existing tests passed. (Focused suites passed; the complete hosted gate is pending.)
  • Successful build pnpm build.
  • Translation keys pnpm i18n:extract.
  • Database migration is not required.

@github-actions

github-actions Bot commented Oct 13, 2026 •

Copy link
Copy Markdown

Hey @snapetech, thanks for submitting this PR! However, it looks like the PR template hasn't been fully filled out.

Issues found:

  • Release Notes must select exactly one primary option: add a release-note fragment or mark the change internal-only. Supporting confirmation boxes may also be checked.

Please update your PR description to follow the PR template.
Incomplete PR descriptions may be closed when required information is missing.
See our Contributing Guide for more details.

This check will automatically re-run when you edit your PR description.

@snapetech
snapetech force-pushed the codex/upstream-tvdb-request-recovery-20261013 branch from db5fcf9 to 10a57d6 Compare October 13, 2026 22:12
@snapetech
snapetech marked this pull request as ready for review October 15, 2026 13:32
@snapetech
snapetech merged commit 6144daa into main Oct 15, 2026
@snapetech
snapetech deleted the codex/upstream-tvdb-request-recovery-20261013 branch October 15, 2026 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant