feat: add setting to disable Sonarr new season monitoring#2561
feat: add setting to disable Sonarr new season monitoring#2561andrew-kennedy wants to merge 1 commit intoseerr-team:developfrom
Conversation
📝 WalkthroughWalkthroughThe changes introduce a new Changes
Sequence Diagram(s)sequenceDiagram
actor User
participant SonarrModal as Sonarr Settings UI
participant SettingsAPI as Settings Service
participant MediaRequestSubscriber as Request Handler
participant SonarrAPI as Sonarr API
User->>SonarrModal: Set monitorNewItems to "all" or "none"
SonarrModal->>SettingsAPI: Save SonarrSettings with monitorNewItems
SettingsAPI->>SettingsAPI: Store monitorNewItems in config
Note over User,SonarrAPI: Later: When adding a new series
MediaRequestSubscriber->>SettingsAPI: Retrieve SonarrSettings
SettingsAPI-->>MediaRequestSubscriber: Return settings with monitorNewItems
MediaRequestSubscriber->>SonarrAPI: Create series with monitorNewItems option
SonarrAPI->>SonarrAPI: Apply monitoring config based on monitorNewItems
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 2✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Comment |
|
As stated here : #2560 There already is a PR for this. But thanks for your contribution either way 😄 |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
server/api/servarr/sonarr.ts (1)
74-105:⚠️ Potential issue | 🟡 MinorNarrow
monitorNewItemstype fromstringto'all' | 'none'.The Sonarr API only accepts
"all"(default) or"none"as valid values for themonitorNewItemsfield at the series root level. The currentstringtype allows any string value, which could result in invalid API requests being silently rejected by Sonarr. Tighten the type in bothSonarrSeries(line 80) andAddSeriesOptions(line 104) to the enum union'all' | 'none'.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@server/api/servarr/sonarr.ts` around lines 74 - 105, The monitorNewItems field is currently typed as string which permits invalid values; update the SonarrSeries interface and the AddSeriesOptions interface to narrow monitorNewItems to the literal union 'all' | 'none' (replace the current monitorNewItems: string declaration in SonarrSeries and AddSeriesOptions with monitorNewItems?: 'all' | 'none' where appropriate) so only the two valid API values are allowed. Ensure you update both the SonarrSeries type and the AddSeriesOptions type references to use the new union.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@server/api/servarr/sonarr.ts`:
- Around line 74-105: The monitorNewItems field is currently typed as string
which permits invalid values; update the SonarrSeries interface and the
AddSeriesOptions interface to narrow monitorNewItems to the literal union 'all'
| 'none' (replace the current monitorNewItems: string declaration in
SonarrSeries and AddSeriesOptions with monitorNewItems?: 'all' | 'none' where
appropriate) so only the two valid API values are allowed. Ensure you update
both the SonarrSeries type and the AddSeriesOptions type references to use the
new union.
ℹ️ Review info
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (5)
seerr-api.ymlserver/api/servarr/sonarr.tsserver/lib/settings/index.tsserver/subscriber/MediaRequestSubscriber.tssrc/components/Settings/SonarrModal/index.tsx
|
Damn, it's really unfortunate that this has languished so long. Can I do anything to help get that other PR merged @0xSysR3ll ? My maintainerr workflows to clean up seasons keep breaking because of how seerr keeps allowing for the adding of seasons that don't have any requests. |
The said PR has been reviewed and is waiting to be merged. We wanted to focus on the first stable release of Seerr before merging feature PRs. It should be available in a future release. |
This PR adds a new setting to the Sonarr configuration that allows users to control the 'Monitor New Seasons' (monitorNewItems) option when adding a new series. Users can now choose between 'All Seasons' (default) and 'No Seasons', providing more granular control over future season monitoring.
This addresses the need to prevent Sonarr from automatically monitoring future seasons for specific instances.
Summary by CodeRabbit