-
-
Notifications
You must be signed in to change notification settings - Fork 560
fix(sonarr): re-monitor episodes when re-requesting deleted but monitored seasons #2312
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(sonarr): re-monitor episodes when re-requesting deleted but monitored seasons #2312
Conversation
…ored seasons When Sonarr's "Unmonitor Deleted Episodes" is enabled, deleted files cause episodes to be unmonitored while the season stays monitored. Re-requesting sets season.monitored = true, but Sonarr only cascades to episodes on state change. Since the season is already monitored, episodes stay unmonitored and searches find nothing. Now explicitly re-monitors episodes for requested seasons before triggering a search. fix #2309
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes an edge case in Sonarr integration where re-requesting deleted seasons fails to grab episodes. When Sonarr's "Unmonitor Deleted Episodes" feature unmonitors individual episodes while leaving seasons monitored, Seerr's re-requests would set the season's monitored flag without cascading to episode-level monitoring, causing searches to find nothing.
Changes:
- Added explicit episode-level monitoring when updating existing series in Sonarr
- Implemented two new API methods:
getEpisodes()to retrieve episodes for a series andmonitorEpisodes()to set episode monitoring state - Added try-catch logic to re-monitor unmonitored episodes before triggering searches
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Can be tested using |
|
Tested by the original reporter and confirmed to work: |
Description
When a user has media that was previously available and then deletes the files, Sonarr's "Unmonitor Deleted Episodes" feature automatically unmonitors the individual episodes while leaving the parent season in a monitored state. This creates an edge case where re-requesting the season through Seerr fails to grab any episodes.
The issue occurs because Seerr sets the season's monitored flag to true, but Sonarr only cascades monitoring state changes down to episodes when it detects an actual change. Since the season is already monitored, Sonarr treats this as a no-op and the episodes remain unmonitored. The search command executes but finds nothing to grab because all episodes are unmonitored at the individual level.
This PR adds explicit episode-level monitoring when updating an existing series. After the series update succeeds and before triggering a search, we now fetch all episodes for the requested seasons and re-monitor any that are currently unmonitored. This ensures that re-requests work correctly regardless of whether the season state changed or episodes were previously unmonitored due to file deletion.
How Has This Been Tested?
(I have not tested this. Can be tested via the image
:preview-remonitor-sonarr-episodes. Steps to test:)Screenshots / Logs (if applicable)
Checklist:
pnpm buildpnpm i18n:extract