Skip to content

feat(sonarr): monitor new seasons when latest is requested - #3157

Open
u61d wants to merge 2 commits into
seerr-team:developfrom
u61d:fix/sonarr-monitor-latest-season
Open

feat(sonarr): monitor new seasons when latest is requested#3157
u61d wants to merge 2 commits into
seerr-team:developfrom
u61d:fix/sonarr-monitor-latest-season

Conversation

@u61d

@u61d u61d commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Description

Adds a third option to the Sonarr Monitor New Seasons setting: Latest Season Requested.

Future seasons are monitored only when the request includes the latest regular season. Older-only requests use No New Seasons, while the existing All and None behavior remains unchanged.

How Has This Been Tested?

  • Ran eslint, prettier check, typecheck, production build, translation extraction, full test suite, and git diff --check
  • Added tests for All, None, latest-season selection, older-season selection, and specials
  • Tested against Sonarr 4.0.17.2952
  • Requested seasons 1 and 2 of The Simpsons and verified Sonarr used No New Seasons
  • Requested the first and latest seasons of S.W.A.T. and verified Sonarr used All Seasons
  • Confirmed only the selected seasons were monitored
  • Confirmed automatic searches and downloads were not started

Screenshots / Logs (if applicable)

The Simpsons with only older seasons requested:
simpsons

S.W.A.T. with the latest season included:
SWAT

Checklist:

  • I have read and followed the contribution guidelines.
  • Disclosed any use of AI (see our policy)
  • I have updated the documentation accordingly.
  • All new and existing tests passed.
  • Successful build pnpm build
  • Translation keys pnpm i18n:extract
  • Database migration (if required)

Summary by CodeRabbit

  • New Features

    • Added a “Latest Season Requested” option to Sonarr’s monitoring settings, enabling monitoring of only the latest requested season.
    • Existing “All” and “None” options continue to work as before.
  • Documentation

    • Updated Sonarr settings guidance and added localized labels for monitoring options.
  • Tests

    • Added coverage for the new season monitoring behavior and edge cases.

@u61d
u61d requested a review from a team as a code owner June 13, 2026 01:50
@coderabbitai

coderabbitai Bot commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 937ea5f7-fa3a-42bc-8cb7-46ad56751fca

📥 Commits

Reviewing files that changed from the base of the PR and between 6a807df and db45593.

📒 Files selected for processing (4)
  • server/lib/settings/index.ts
  • server/subscriber/MediaRequestSubscriber.ts
  • src/components/Settings/SonarrModal/index.tsx
  • src/i18n/locale/en.json
🚧 Files skipped from review as they are similar to previous changes (4)
  • src/components/Settings/SonarrModal/index.tsx
  • server/lib/settings/index.ts
  • src/i18n/locale/en.json
  • server/subscriber/MediaRequestSubscriber.ts

Included review availability: Your plan includes up to 10 reviews per rolling hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

This PR adds a 'latest' option to Sonarr's monitorNewItems setting. When selected, the resolver monitors all new seasons only when the request includes the latest available regular season.

Changes

Sonarr 'latest' season monitoring feature

Layer / File(s) Summary
Monitor behavior logic: type contract and resolution utility
server/lib/settings/index.ts, server/utils/sonarr.ts, server/utils/sonarr.test.ts
The setting type now includes 'latest'. resolveMonitorNewItems returns 'all' when the latest available regular season is requested and 'none' otherwise. Tests cover pass-through settings and latest-season scenarios.
Series creation integration
server/subscriber/MediaRequestSubscriber.ts
Sonarr series creation now resolves monitorNewItems from the configured setting, requested seasons, and available TMDB seasons.
Settings UI and localization
src/components/Settings/SonarrModal/index.tsx, src/i18n/locale/en.json
The dropdown uses localized labels and includes “Latest Season Requested”. The help text and English translations are updated.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to db455

This change adds a localized Sonarr monitoring option with targeted tests and validation reported by the author; no actionable merge-blocking risk remains beyond normal checks and review.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant SonarrModal
  participant MediaRequestSubscriber
  participant resolveMonitorNewItems
  participant Sonarr

  User->>SonarrModal: Select 'Latest Season Requested' and request seasons
  SonarrModal->>MediaRequestSubscriber: Submit media request with seasons
  MediaRequestSubscriber->>resolveMonitorNewItems: Pass setting, requestedSeasons, and availableSeasons
  alt Latest regular season is requested
    resolveMonitorNewItems-->>MediaRequestSubscriber: Return 'all'
  else Latest regular season is not requested
    resolveMonitorNewItems-->>MediaRequestSubscriber: Return 'none'
  end
  MediaRequestSubscriber->>Sonarr: Create series with resolved monitorNewItems
Loading

Poem

🐰 A rabbit checks the seasons in line,

The latest request makes monitoring shine.
Older-only picks return “none,”
All and none still pass unchanged.
Sonarr now follows the request’s design.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes adding latest-season monitoring behavior for Sonarr.
Linked Issues check ✅ Passed The changes satisfy issue #3152 by enabling future-season monitoring only when the latest regular season is requested.
Out of Scope Changes check ✅ Passed All code, tests, and localization changes directly support the Sonarr latest-season monitoring objective.

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we want tests for Sonarr yet.
@fallenbagel wdyt? Maybe we should do add all *arr tests at once in another PR?

If so, the whole PR could be simplified without that resolveMonitorNewItems helper function.

@github-actions github-actions Bot added the merge conflict Cannot merge due to merge conflicts label Aug 18, 2026
@github-actions

Copy link
Copy Markdown

This pull request has merge conflicts. Please resolve the conflicts so the PR can be successfully reviewed and merged.

@github-actions github-actions Bot removed the merge conflict Cannot merge due to merge conflicts label Aug 18, 2026
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.

Only add monitorNewItems to Sonarr if request includes latest season

2 participants