Skip to content

fix(radarr): initiate Radarr movie search only if movie is available - #3533

Open
kinn81 wants to merge 1 commit into
seerr-team:developfrom
kinn81:improve-radarr-addmovie-searchlogic
Open

kinn81 wants to merge 1 commit into
seerr-team:developfrom
kinn81:improve-radarr-addmovie-searchlogic

Conversation

@kinn81

@kinn81 kinn81 commented Sep 22, 2026

Copy link
Copy Markdown

Description

When a user requests a movie that already exists in Radarr, Seerr initiates a Radarr movie search that ignores whether the movie is available or not. This effectively bypasses the minimum availability setting (e.g., whether the movie is released or not).

This change adds a check of the movie's availability status before triggering the Radarr search. This applies in two places, when the movie is already monitored and when it exists but is unmonitored and Seerr re-enables it.

AI Disclosure: I used Claude Code to understand the codebase, write 2 of the 4 tests following my structure from the first two, and for a final review of the change.

Searching for a not-yet-available movie bypasses the minimum availability setting and increases the chance of Radarr grabbing an incorrect, but identically named, title.

How Has This Been Tested?

I added test cases covering the changed logic and following the existing test patterns.

  • An existing monitored movie that is not yet available does not trigger a search.
  • An existing monitored movie that is available does trigger a search.
  • An existing unmonitored movie that is not yet available is set to monitored but does not trigger a search.
  • An existing unmonitored movie that is available is set to monitored and does trigger a search.

I ran npm test -- server/api/servarr/radarr.test.ts to confirm all existing and new tests pass.

Screenshots / Logs (if applicable)

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

  • Bug Fixes
    • Movie searches now run only when Radarr reports that the movie is available.
    • Improved handling for existing movies that are not yet available, preventing unnecessary search attempts.
    • Updated monitoring behavior ensures previously unmonitored movies are updated before eligible searches run.

@kinn81
kinn81 requested a review from a team as a code owner September 22, 2026 00:02
@coderabbitai

coderabbitai Bot commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 70f45ee5-bcae-4948-ad68-3404423a10fd

📥 Commits

Reviewing files that changed from the base of the PR and between 794743a and cee1b88.

📒 Files selected for processing (2)
  • server/api/servarr/radarr.test.ts
  • server/api/servarr/radarr.ts

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


📝 Walkthrough

Walkthrough

RadarrAPI.addMovie now triggers searches for existing movies only when Radarr marks them as available. New tests cover monitored and unmonitored movie paths, PUT updates, and search call conditions.

Changes

Radarr search gating

Layer / File(s) Summary
Availability checks in addMovie
server/api/servarr/radarr.ts
Both existing-movie branches now require isAvailable before calling searchMovie. The related log messages were updated.
Search condition tests
server/api/servarr/radarr.test.ts
Four tests cover monitored and unmonitored existing movies, availability conditions, PUT updates, and search arguments.

Priority: ➖ Normal

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

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: fallenbagel, gauthier-th

🚥 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 and concisely describes the main change: Radarr movie searches now run only when the movie is available.
Linked Issues check ✅ Passed Issue #3512 requires searchMovie() to run only when an existing Radarr movie is available. server/api/servarr/radarr.ts now gates the search on response.data.isAvailable after updating an existi…
Out of Scope Changes check ✅ Passed The changes are limited to the Radarr availability gates, related log messages, and automated tests for the behavior required by issue #3512. No unrelated product behavior or files are changed.

Warning

⚠️ This pull request shows signs of AI-generated slop (redundant_comments). It has been flagged by CodeRabbit slop detection and should be reviewed carefully.


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

A rabbit checks the movie’s state,
Before the search can leap the gate.
Monitored paths now pause and see,
If availability agrees.
Tests hop through each guarded way,
And safer searches start today.

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

@github-actions

This comment has been minimized.

@github-actions github-actions Bot closed this Sep 22, 2026
@github-actions github-actions Bot locked as spam and limited conversation to collaborators Sep 22, 2026
@github-actions github-actions Bot reopened this Sep 22, 2026
@github-actions github-actions Bot unlocked this conversation Sep 22, 2026
@fallenbagel

fallenbagel commented Sep 22, 2026

Copy link
Copy Markdown
Member

Re-opened for human review.

EDIT: Reviewed and it seems it was a false positive.

@fallenbagel fallenbagel added awaiting triage This issue needs to be reviewed and removed awaiting triage This issue needs to be reviewed labels Sep 22, 2026

This branch has not been deployed

No deployments
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.

Adding a movie that already exists in Radarr triggers a search that skips the isAvailable gate

2 participants