Rescan Folder on Add from DVR

Sonarr version (exact version): 2.0.0.5085
OS: Unraid 6.4 Docker
Description of issue: Hi there

So I’ve searched around and I’m not finding a good solution. Here is what I’m trying to do.

I recently got a HD Homerun Prime and a Cable Card and am trying to be “responsible” and record most of my TV through Plex. What I want to do is if the recording fails, to have sonarr automatically d/l the missing recording.

I’ve got it all pretty much working how I want, If plex records it goes into /media/Tv Shows/Name of Series. Or if sonarr download’s it, it goes to the same place. I have all my shows in sonarr set to a 60 min delay.

What I need to figure out how to do, is have Sonarr “rescan” the series upon plex recording it so that it picks up the file is there and to not download the episode. I found a little information on the RescanSeries api call, but I know nothing about how to manually invoke an API call or how to trigger it automatically upon plex recording.

Any help or a nudge in the right direction would greatly be appreciated.

Rob

Nevermind, I got this to work. Not the most elegant solution, but I’m having plexpy run a script upon anything being added to Plex that tells Sonarr to rescanseries.

@OneEyedWookie could you please elaborate on the script? I just switched from sickbeard to Sonarr and this is the one thing I am missing. I am running PlexPy as well. Currently I have Plex DVR recording shows and I have Sonarr on a delay but I want Sonarr to skip the download trigger if my HD Homerun already grabbed it.

Thank you!

My process is the following:

In sonarr, each series that I record with the HDHOMERUN Prime has a tag labeled “hdhomerun”

Those are each on a 5 hour delay to account for Time Zone from East Coast to West Coast and for them to become available.

When they record with plex, they are automatically placed in the media folder. (Watch the folder structure, Sonarr likes to default to “Series Name” where stuff that’s recorded with Plex goes to “Series Name (Year)” After the first time I record a show, I change the path in Sonarr to point to the “Series Name (Year)”, move anything from the old folder and then delete it and your good to go.

When the show is recorded and put into the right folder and added to plex, I have PlexPy send a notfication to the “Script Agent” which causes the below script to run.

Here is the script I’m using.

#!/bin/bash

#seriesID=$(curl -s http://SERVER URL:PORT/api/series -H ‘X-Api-Key: **API KEY HERE **’ --compressed | jq -rs --arg seriestitle $seriesName ‘.[]| .[] | select(.title == $seriestitle ) | .id’)

curl -s SERVER URL:PORT/api/command -H ‘X-Api-Key: **API KEY HERE **’ --data-binary ‘{ “name”: “rescanSeries”, “seriesId” : "’$seriesID’" }’

Make sure you put in your API Key for Sonarr and your Server URL and Port Number.

This will cause sonarr to run a “Series Refresh” which will cause the episode to show up in Sonarr.

The next time Sonarr does it’s RSS scan (Usually every 15 minutes, it will see that the episode has been aquired and will cancel the delayed download"

If the recording fails for some reason, it will automatically download the episode after the delay has expired.

I hope that all made sense. Let me know if you have any questions.

R

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.