I'm trying to understand the order that things happen. I'm using Sonarr (formerly NzbDrone) with completed download handling enabled *and* I'm running a post processing script.
Every minute, Sonarr checks with SABnzbd to see if a download is complete. Bottom line: I don't want Sonarr to pick the files until my script finishes execution.
Does SABnzbd wait until my script finishes before it (and hopefully Sonarr) considers the download complete?
SABnzbd, Sonarr & Scripts
Re: SABnzbd, Sonarr & Scripts
No, Sonarr does not wait.
Find SABNZBD script help here: http://wiki.sabnzbd.org/user-scripts
You have to disable (Drone Factory Folder Scanning) by setting it to '0' in the advanced settings.
https://github.com/Sonarr/Sonarr/wiki/D ... r-Scanning
Then you have to force a scan at the end of your script.
python requires the REQUESTS module
Find SABNZBD script help here: http://wiki.sabnzbd.org/user-scripts
You have to disable (Drone Factory Folder Scanning) by setting it to '0' in the advanced settings.
https://github.com/Sonarr/Sonarr/wiki/D ... r-Scanning
Then you have to force a scan at the end of your script.
python requires the REQUESTS module
Code: Select all
import requests, json
try:
r = requests.post("http://localhost:8989/api/command", data=json.dumps({'name': 'downloadedepisodesscan', 'path': sys.argv[1]}), headers={'X-Api-Key': 'API_KEY_HERE'})
rstate = r.json()
print "Sonarr responds as "+rstate['state']+"."
except:
print "Update to Sonarr failed, check if Sonarr is running, your API key, or check install of python module requests."
sys.exit(1)
sys.exit(0)
-
- Newbie
- Posts: 5
- Joined: March 4th, 2014, 9:09 pm