From 82d27fa744a0683cd4a3817c1a1eb2baaaf4044b Mon Sep 17 00:00:00 2001 From: clinton-hall Date: Thu, 13 Dec 2012 00:41:02 -0800 Subject: [PATCH] Added watch_dir Allows this script to be run on a different PC to the Sickbeard Server. The directory structure will most probably not match in this case, so we specify a default watch directory in the config. This directory should be the location that completed TV episodes are placed by sabnzbd or nzbget, as mounted on the SickBeard Server. --- autoProcessTV.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/autoProcessTV.py b/autoProcessTV.py index b696fbf0..c530f97c 100644 --- a/autoProcessTV.py +++ b/autoProcessTV.py @@ -60,6 +60,7 @@ def processEpisode(dirName, nzbName=None, status=0): print "Could not read configuration file: ", str(e) sys.exit(1) + watch_dir = "" host = config.get("SickBeard", "host") port = config.get("SickBeard", "port") username = config.get("SickBeard", "username") @@ -73,12 +74,21 @@ def processEpisode(dirName, nzbName=None, status=0): web_root = config.get("SickBeard", "web_root") except ConfigParser.NoOptionError: web_root = "" + + try: + watch_dir = config.get("SickBeard", "watch_dir") + except ConfigParser.NoOptionError: + watch_dir = "" try: failed_fork = int(config.get("SickBeard", "failed_fork")) except (ConfigParser.NoOptionError, ValueError): failed_fork = 0 + #allows us to specify the default watch directory and call the postproecssing on another PC with different directory structure. + if watch_dir != "": + dirName = watch_dir + params = {} params['quiet'] = 1