Skip to content

Latest commit

 

History

History
215 lines (162 loc) · 11.1 KB

File metadata and controls

215 lines (162 loc) · 11.1 KB

Owinenatorr

Owinenatorr is a Powershell script that kicks off rename operations programatically in Radarr and Sonarr after changing the naming scheme for movies or series.

Usage

Why should I use this script?

You should use this script if you want to slowly and programatically rename your media items instead of renaming them all at once.

Requirements

  • Powershell 7
  • Radarr
    • Radarr → Settings → Media Management
      • Rename Movies
  • Sonarr:
    • Sonarr → Settings → Media Management
      • Rename Episodes

Script Parameters

ApplicationList - Specifies which app(s) to use.

ConfigurationFile - Specifies a path to the config file, defaults to $PSScriptRoot\owinenatorr.conf.

Config File Attributes

Warning

Do not use any quotation marks within the config file

Radarr Configuration Attributes

Attribute Description Default Value Allowed Values
ApiKey Radarr API Key from Settings → General "" alphanumeric string
Count Number of movies to be renamed 10 integer > 0
IgnoreTag Used for filtering media items - movies with this tag will be ignored "" alphanumeric string
Monitored Used for filtering media items
  • empty: Any movies can be selected
  • false: Only unmonitored movies will be selected
  • true: Only monitored movies will be selected
"" boolean (true/false)
MovieStatus Used for filtering media items - movies with this status will be selected "released"
  • announced
  • in cinemas
  • released
QualityProfileName Used for filtering media items - movies with this quality profile will be selected "" alphanumeric string
TagName Used for filtering media items - name of the tag that will be applied to the movies that were checked "" alphanumeric string
Url Radarr URL starting with "http(s)://" including baseurl and port if required "" URL

Sonarr Configuration Attributes

Attribute Description Default Value Allowed Values
ApiKey Sonarr API Key from Settings → General "" alphanumeric string
Count Number of series to be renamed 5 integer > 0
IgnoreTag Used for filtering media items - series with this tag will be ignored "" alphanumeric string
Monitored Used for filtering media items
  • empty: Any series can be selected
  • false: Only unmonitored series will be selected
  • true: Only monitored series will be selected
true boolean (true/false)
QualityProfileName Only series with this quality profile with be searched "" alphanumeric string
SeriesStatus Used for filtering media items - series with this status will be selected ""
  • continuing
  • upcoming
  • ended
TagName Used for filtering media items - name of the tag that will be applied to the movies that were checked "" alphanumeric string
Url Sonarr URL starting with "http(s)://" including baseurl and port if required "" URL

How To Use

Linux

  • Clone repo: git clone "https://github.com/angrycuban13/Just-A-Bunch-Of-Starr-Scripts" "/path/to/repo/clone/location/"
    • Alternatively you can copy and paste the script contents by clicking on this link
  • Create config from the example: cp /path/to/repo/clone/location/owinenatorr-example.conf /path/to/repo/clone/location/owinenatorr.conf
    • Alternatively you can copy/paste the config file by clicking on this link
  • Update the config file and enter the parameters in owinenatorr.conf
  • Run script

Windows

  • Clone repo: git clone "https://github.com/angrycuban13/Just-A-Bunch-Of-Starr-Scripts" "/path/to/repo/clone/location/"
    • Alternatively you can copy and paste the script contents by clicking on this link
  • Create config from the example: cp /path/to/repo/clone/location/owinenatorr-example.conf /path/to/repo/clone/location/owinenatorr.conf
    • Alternatively you can copy/paste the config file by clicking on this link
  • Update the config file and enter the parameters in owinenatorr.conf
  • Run script

Unraid

Important

Requires Powershell 7 plugin via NerdTools (Unraid 6.11.5) and User Scripts plugin

  • Install NerdTools from CA (if not installed)
  • Install powershell-7.2.7 or newer from NerdTools Plugin Menu
  • Install User Scripts plugin from CA
  • Save the Owinenatorr script somewhere easy to maintain (Recommended on your appdata share) e.g., /mnt/user/appdata/scripts.
    • Save as owinenatorr.ps1.
  • Save the config file in the same directory as the Owinenatorr script.
    • Save as owinenatorr.conf.
  • Update the config file and enter the parameters in owinenatorr.conf

Note

Owinenatorr uses app name arguments. So whatever you have setup in the config is what argument you'll use in the script. For instance if you have Radarr and Radarr4K in your config, your arguments will be -ApplicationList radarr,radarr4k respectively.

  • Go to Plugins → Settings → User Scripts
  • Click Add New Script.
    • Name it Owinenatorr.
  • Click the gear icon next to Owinenatorr and Edit Script.
  • Paste pwsh /mnt/user/appdata/scripts/owinenatorr.ps1 -ApplicationList radarr into the script.
    • Adjust the app names as required for your setup (e.g., radarr, radarr4k, sonarr, sonarr4k)
  • After that, you can click Run Script, Run in Background or set up to run the script on a schedule by clicking Schedule Disabled and setting it to whatever you prefer.
    • If you'd like the script to run every 6 hours, select Custom, and the cron will be 0 */6 * * * where you can replace the 6 with whatever interval you'd like.

Docker Compose

Warning

This Docker Compose example will only run once. If you want to run it on a schedule you will need to cron it

# powershell - https://hub.docker.com/_/microsoft-powershell
  powershell:
    container_name: powershell
    image: mcr.microsoft.com/powershell:latest
    restart: "no"
    # optional
    logging:
      driver: json-file
      options:
        max-file: 10
        max-size: 200k
    # optional
    environment:
      - PUID=1000
      - PGID=1000
    volumes:
      - /path/to/appdata/powershell:/scripts
    command: pwsh /scripts/Owinenatorr/owinenatorr.ps1 -ApplicationList radarr,sonarr
docker start powershell

Linux Usage Example

One Time - Single App - Linux

pwsh /path/to/repo/clone/location/Owinenatorr/owinenatorr.ps1 -ApplicationList radarr

One Time - Multiple Apps - Linux

pwsh /path/to/repo/clone/location/Owinenatorr/owinenatorr.ps1 -ApplicationList radarr,sonarr

Scheduled Crontab

0 */6* **  pwsh /path/to/repo/clone/location/Owinenatorr/owinenatorr.ps1 -ApplicationList radarr,sonarr

Windows Usage Example

One Time - Single App - Windows

pwsh /path/to/repo/clone/location/Owinenatorr/owinenatorr.ps1 -ApplicationList radarr

One Time - Multiple Apps - Windows

pwsh /path/to/repo/clone/location/Owinenatorr/owinenatorr.ps1 -ApplicationList radarr,sonarr

Scheduled Task

  • Open Task Scheduler
  • Create new task
  • Under the General tab
    • Give your task a name, e.g "Owinenatorr Script"
    • Set your security options appropiately (see warning below)
  • Under the Triggers tab
    • Create a schedule of your choice
  • Under the Actions tab
    • Action : Start a program
    • Program/script : pwsh.exe
    • Add arguments (optional): -File /path/to/owinenatorr.ps1

Warning

It is never recommended to run scripts as SYSTEM. We suggest you use a service account to run your schedule tasks.

Dry Run

Tip

Useful if you want to see what the script is going to do

pwsh /path/to/repo/clone/location/Owinenatorr/owinenatorr.ps1 -ApplicationList radarr -WhatIf

Verbose

Tip

Useful for debugging

pwsh /path/to/repo/clone/location/Owinenatorr/owinenatorr.ps1 -ApplicationList radarr -Verbose