Skip to content

Season numbering from Sonarr (TVDB) instead of TMDB - #31

Merged
Rombond merged 12 commits into
masterfrom
feat/tvdb-seasons
Nov 12, 2026
Merged

Rombond merged 12 commits into
masterfrom
feat/tvdb-seasons

Conversation

@Rombond

@Rombond Rombond commented Nov 12, 2026

Copy link
Copy Markdown
Owner

Problem

Tipsarr listed TV seasons from TMDB, but Sonarr, the Jellyfin folders and users use TVDB numbering. For Bleach (TMDB 30984) TMDB has 2 seasons and TVDB has 17. A request for "season 2" (the Thousand-Year Blood War arc) monitored Sonarr season 2, a different arc.

What changes

  • For shows, the season list and numbering come from Sonarr (TVDB). TMDB still supplies posters, synopsis, cast and discovery, and the season list when Sonarr is unavailable or the show has no TVDB id (seasonNumbering: "tmdb").
  • media.Detail takes an injected SeasonSource, only for callers that opt in (Opts.Seasons), so no path can show TMDB seasons by mistake. A TVDB season borrows a TMDB name/poster only when first air date and episode count both match (Bleach S17 = TMDB S2).
  • Requests store their numbering (requests.season_numbering, migration 032). Rows made before this, or while Sonarr was unreachable, are tmdb and are checked at approval: a request that cannot be mapped fails instead of monitoring the wrong season.
  • A stale client gets 409 season_numbering_changed.
  • Requesting seasons of a show Sonarr already tracks now monitors and searches them (MonitorSeasons, never unmonitors); it used to do nothing.
  • TV quota: one request counts at most the user's limit.
  • Season detail (/media/tv/{id}/seasons/{n}) uses the TVDB number and can return an empty episode list.
  • Web, iOS and Android: note when numbering differs, no episode count when it is 0 (unknown), seasonNumbering sent with requests. API additions are additive, so shipped apps keep working.
  • devenv and demo fixtures gain a show whose numbering differs; docs updated (FAQ, notifications, upgrading 0.18).

Testing

  • go test -count=1 ./..., go vet, gofmt, npm run check, check:i18n, npm run build.
  • Bleach tests against fake TMDB/Sonarr: lookup-only, tracked series, Sonarr down, live and dry-run requests, legacy tmdb rows, imports, migration backfill (SQLite only).
  • Run locally against a copy of the production database and the real Sonarr in dry-run: Bleach shows 17 seasons.

Not verified

  • iOS and Android were not compiled (no Swift toolchain or Android SDK here). Check the generated seasonNumbering names on iOS before release.
  • Migration not run on Postgres/MySQL.
  • A hanging Sonarr can take up to about 7 s for the detail page (4 s series read plus 3 s episode list); refusing connections falls back immediately.

After merge

Existing wrong requests are not rewritten. The Bleach request made with season 2 has to be fixed by hand in Sonarr.

@Rombond
Rombond merged commit f3f8a1f into master Nov 12, 2026
2 of 3 checks passed
@Rombond
Rombond deleted the feat/tvdb-seasons branch November 12, 2026 23:33
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