Script to check for TV Show and Anime episodes that may be named with "Episode ##" or "TBA" that should not be, IE: episode name data was missing or incorrect within Sonarr when the episode was imported. Output can be displayed right in the CLI once the script completes:
And/or a Discord notification can be sent to a custom webhook:
- Clone or download the repo.
- Properly set your media storage path in the script.
- Modify the two exclude list text files to meet your needs.
- If you do not have anything to exclude make sure you blank out the file because they are both required to be there.
- Determine and set your corresponding column value.
- Mine is like this:
/mnt/data/media/Videos/TV Shows/Show Name/Season 1/Episode Name
- It ends up as column
7
with/
as the delimiter because/mnt
is actually the SECOND one and not the first. - For a more visual representation:
(1)/(2)mnt/(3)data/(4)media/(5)Videos/(6)TV Shows/(7)Show Name/
- Mine is like this:
- Set any other variables you would like to set.
- If
notify
is set totrue
, but you did not set thewebhook
variable the script will prompt you to enter it the first time you run it.
- If
Warning Depending on your directory structure this might not work for you. It is possible that you might need to put a path, run the script, adjust the path, run the script, etc. to get all your results. It can take some trial and error for you to get all of the shows you need/want to exclude as you will want to run the script and then check the shows that are listed for whether or not their episodes are actually named
Episode ##
or not.
Note This Powershell script directly interacts with Sonarr's API. It does not support a Discord webhook like the bash script does. Instead we recommend you setup a webhook under
Settings > Connect
and selectRename
to get Discord notifications when this script runs.
- Clone or download the repo.
- Fill in the appropriate variables in
Powershell\SonarrEpisodeNameChecker.ps1
- Modify the two exclude list text files to meet your needs.
⚠️ If you do not have anything to exclude make sure you blank out the files because they are both required to be there.
- Variables
⚠️ Required$sonarrApiKey
: Your Sonarr API Key.⚠️ Required$sonarrUrl
: Your Sonarr URL.- ☑️ Not required
$sonarrSeriesStatus
: Accepts any values listed here.
Note It is highly recommended that you do a dry run to see which series might need to be added to your exclusion list!
🐳 Docker image (hopefully) coming soon!
Now that you have it configured so that everything is working properly, you can use a cronjob to schedule the script to run automatically.
Here's an example of running the script every day at 4am:
# Run the Sonarr Episode Name Checker script
0 4 * * * /home/tronyx/scripts/SonarrEpisodeNameChecker.sh
# Run the Sonarr Episode Name Checker script
0 4 * * * /home/tronyx/scripts/Powershell/SonarrEpisodeNameChecker.ps1 -renameSeries $true
If you have any questions, you can find me on the Organizr Discord.