Skip to content

Conversation

@mescon
Copy link
Contributor

@mescon mescon commented May 27, 2025

Unmonitor Radarr/Sonarr Plugins

This PR adds two new plugins to help with post-processing after successful transcodes:

unmonitorRadarr

This plugin automatically unmonitors a movie in Radarr after a successful transcode to prevent it from being re-downloaded.

Features:

  • Finds the correct movie using multiple methods:
    • IMDB ID detection
    • Parse API
    • File path matching
  • Sets the movie to unmonitored state
  • Provides feedback in logs
  • Outputs to different paths based on success/failure

Configuration Options:

  • Radarr API Key
  • Radarr Host URL

unmonitorSonarr

This plugin automatically unmonitors an episode in Sonarr after a successful transcode to prevent it from being re-downloaded.

Features:

  • Finds the correct episode using multiple methods:
    • IMDB ID detection
    • Parse API
    • File path matching
  • Sets the episode to unmonitored state
  • Optionally unmonitors the entire series if no monitored episodes with files remain
  • Provides detailed feedback in logs
  • Outputs to different paths based on success/failure

Configuration Options:

  • Sonarr API Key
  • Sonarr Host URL
  • Unmonitor Series If No Episodes Remain (optional)

Use Case

These plugins are particularly useful in automated media management workflows where:

  1. Media is automatically downloaded
  2. Transcoded to a preferred format
  3. And should not be re-downloaded after successful processing

Testing

Both plugins have been tested with:

  • Radarr v4.x and Sonarr v4.x
  • Various file naming formats
  • Files with and without IMDB IDs
  • Various directory structures

@Marnalas
Copy link
Contributor

Very interesting!

If it is of any interest to you, I have a PR (#812) for a plugin that sets variables with info from Sonarr and Radarr. The benefit for you would be that you could avoid having to handle the retrieval of the id for the show/movie. From what I see (I could be wrong) the preconditions are the same (various file naming formats, files with and without IMDB IDs and various directory structures) and that would make your plugins also use tvdb and tmdb ids.
Again, it's just food for thoughts.

@mescon
Copy link
Contributor Author

mescon commented May 28, 2025

Oooh - your plugin looks really useful!
You're more than welcome to to integrate the relevant parts from your script - that would probably be nice, but as it stands right now, the scripts fulfill my needs already.

I initially looked for a tool that would scan sonarr/radarr for tags, and depending on the tag would initiate different behaviors. A tag could be "archive-av1", and that would start the av1 flow... that was all backwards, so ended up doing this PR instead.

- Fixed ESLint line length violations in both plugins
- Improved code readability by breaking long expressions into multi-line functions
- Split complex filter operations into separate variables
- Enhanced log message formatting for better debugging
- Generated corresponding JavaScript files via TypeScript compilation

All lint errors resolved and plugins validated successfully.
@mescon
Copy link
Contributor Author

mescon commented Jun 2, 2025

@HaveAGitGat For your consideration :-)
Let me know if there is anything with the plugins that are not up to par!
Also - thank you for Tdarr, it's currently working on saving me ~200 TB ;-)

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.

2 participants