Repository navigation
fix(scanners): don't orphan a show Sonarr carries under another tvdb id - #3605
fallenbagel wants to merge 1 commit into
Conversation
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes.
|
| Layer / File(s) | Summary |
|---|---|
Track scanned IDs for orphan cleanup server/lib/scanners/sonarr/index.ts, server/lib/scanners/sonarr/sonarr.test.ts |
The scanner clears and records scanned TMDB IDs by profile. Orphan cleanup checks both TMDB and TVDB IDs for standard and 4K scans. A regression test verifies that processing media and its approved request remain unchanged when the returned show has a different TVDB ID. |
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix
Merge Risk: 
Minimal · previous review 15ecf
-
The reported regression is covered by the new test, and no actionable issue remains from this review.
Pre-merge checks | 
4
-
✅ Passed checks (4 passed)
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
A rabbit checks the scan at dawn
Two sets of TMDB IDs are drawn
A show with a changed TVDB stays
Its request keeps its approved phase
The rabbit hops through fields of green
addc9ac to
15ecf91
Compare
The orphan cleanup matched shows to the scanned series by media.tvdbId, which can come from TMDB and differ from the tvdbId Sonarr uses for the series. processShow still found such a show by tmdbId and kept it PROCESSING, but the cleanup then missed it among the scanned ids, failed to confirm it against the servers under the wrong id, and reset it to UNKNOWN and declined its request in the same run. A show whose tmdbId was resolved from a scanned series of that quality is no longer treated as orphaned.
15ecf91 to
c76a504
Compare
seerr
|
||||||||||||||||||||||||||||
| Project |
seerr
|
| Branch Review |
fix/sonarr-orphan-tmdb-gate
|
| Run status |
|
| Run duration | 02m 04s |
| Commit |
|
| Committer | fallenbagel |
| View all properties for this run ↗︎ | |
| Test results | |
|---|---|
|
|
0
|
|
|
0
|
|
|
0
|
|
|
0
|
|
|
33
|
| View all changes introduced in this branch ↗︎ | |
Description
The Sonarr orphan cleanup decides a show is gone from Sonarr by looking for its stored TVDB id among the series it just scanned, then asking each server for that id. A show's stored TVDB id can come from TMDB when it was first requested, and that can differ from the TVDB id Sonarr has the series under. The scan still matches such a series to the show by its TMDB id and keeps it PROCESSING, but the cleanup then misses it under the stored id, resets the show to UNKNOWN and declines its request in the same run, even though Sonarr is still dowloading it.
The scan now also remembers the TMDB ids it resolved for each quality, and the cleanup skips a show whose TMDB id is among them before asking the servers.
How Has This Been Tested?
Screenshots / Logs (if applicable)
Checklist:
pnpm buildpnpm i18n:extractStack created with GitHub Stacks CLI • Give Feedback 💬
Summary by CodeRabbit