Skip to content

Commit

Permalink
Added NZB path to Sonarr folder scan
Browse files Browse the repository at this point in the history
Added NZB path to Sonarr scan call to only scan the processed folder

Update nzbToSonarrMP4.py

Changed option description to me more detailed. More debugging. Fully working. Needs testing by more users.
  • Loading branch information
zybeon committed Feb 10, 2015
1 parent 4ffbd25 commit 8b2d114
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions nzbToSonarrMP4.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
##############################################################################
### OPTIONS ###

# Change to MP4 Automator folder, no quotes and a trailing /
# Change to full path to MP4 Automator folder. No quotes and a trailing /
#MP4_FOLDER=~/sickbeard_mp4_automator/

### NZBGET POST-PROCESSING SCRIPT ###
Expand Down Expand Up @@ -83,6 +83,7 @@
sys.exit(POSTPROCESS_NONE)

# All checks done, now launching the script.
#print os.environ['NZBPO_MP4_FOLDER']+"autoProcess.ini"
settings = ReadSettings(os.path.dirname(sys.argv[0]), os.environ['NZBPO_MP4_FOLDER']+"autoProcess.ini")

path = os.environ['NZBPP_DIRECTORY']
Expand All @@ -103,6 +104,7 @@
print "[INFO] Successfully converted!"
except:
print "[WARNING] File conversion failed"
raise
sys.exit(POSTPROCESS_ERROR)
#else:
# print "Possible sample file detected: " + inputfile + " skipping file"
Expand All @@ -121,10 +123,11 @@
else:
protocol="http://"
url = protocol+host+":"+port+"/api/command"
payload = {'name': 'downloadedepisodesscan'}
payload = {'name': 'downloadedepisodesscan','path': path}
headers = {'X-Api-Key': apikey}
r = requests.post(url, data=json.dumps(payload), headers=headers)
print "[INFO] Sonarr folder scan is "+r.headers['state']
rstate = r.json()
print "[INFO] Sonarr update is "+rstate['state']+"."

sys.exit(POSTPROCESS_SUCCESS)

Expand Down

0 comments on commit 8b2d114

Please sign in to comment.