Repository navigation
fix(scanners): settle orphaned season requests in the Sonarr orphan pass - #3606
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 |
|---|---|
Season reset reason and resolution server/lib/scanners/baseScanner.ts |
Season-reset candidates can carry an orphan reason. Resolution skips the abandonment check for these candidates and uses the reason when declining requests. rollUpShowStatus and recordSeasonReset are now protected. |
Metadata lookup and per-show cleanup server/lib/scanners/sonarr/index.ts |
Metadata-provider selection is shared by scanned and orphaned shows. Orphan cleanup retrieves seasons, updates processing statuses, rolls up and saves show status, and records resets for abandoned seasons. |
Candidate selection and scan integration server/lib/scanners/sonarr/index.ts, server/lib/scanners/sonarr/sonarr.test.ts |
Standard and 4K cleanup select shows with processing statuses or approved requests, then pass shows absent from Sonarr to shared cleanup. Tests cover standard and 4K resets, retained show statuses, and request outcomes. |
Estimated code review effort: 3 (Moderate) | ~25 minutes
Change: Bug fix
Merge Risk: 
Minimal · previous review ae2a8
-
This change settles orphaned season requests when Sonarr drops a series, so those seasons can be requested again. No merge-blocking risk is evident from the supplied 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 seasons’ trail
And notes which shows have left the vale
The statuses settle, neat and clear
Requests find their endings here
Four-kay paths get the same review
Then hops away beneath the moonlit blue
12e1712 to
ae2a878
Compare
The orphan cleanup only checked shows whose own status was PROCESSING, so a deleted or partially available show kept a PROCESSING season and an APPROVED request forever once its series left Sonarr, blocking that season from being requested again. Those shows are now cleaned up too, with the show status rolled up from its seasons and each request settled per season as at end of run.
ae2a878 to
94e1cf3
Compare
seerr
|
||||||||||||||||||||||||||||
| Project |
seerr
|
| Branch Review |
fix/orphaned-season-requests
|
| Run status |
|
| Run duration | 02m 21s |
| 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 only looks at shows whose own status is PROCESSING. A show with one season available and another requested and still downloading rolls up to partially available, so when its series is removed from Sonarr the requested season stays PROCESSING and its request stays approved. Both block that season from being requested again, and nothing ever resolves them. Availability sync reaches the same state from the other side. When a show's series is gone from Sonarr and the show is missing from the media server, it marks the show deleted but leaves a requested season PROCESSING, and the cleanup skips deleted shows too. A media server scan can also reset the requested season to UNKNOWN first, leaving only the approved request behind.
The cleanup now also picks up shows with a PROCESSING season or an approved request for that quality, once the series is confirmed missing from every Sonarr server as before. Their PROCESSING seasons are reset, and the show status is rolled up from its seasons instead of being forced to UNKNOWN, so a show that still has an available season ends up partially available. Their requests are settled the same way #3579 settles abandoned seasons at the end of a run. Abandoned seasons are removed from the request, a request whose remaining seasons are all delivered is completed, and one with nothing left is declined.
Note
Rolling the show up needs its season list, so a show whose lookup fails is left for the next scan rather than reset.
How Has This Been Tested?
Screenshots / Logs (if applicable)
Checklist:
pnpm buildpnpm i18n:extractStack created with GitHub Stacks CLI • Give Feedback 💬
Summary by CodeRabbit