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.
This commit is contained in:
clinton-hall 2012-12-13 00:41:02 -08:00
parent 71808201d8
commit 82d27fa744

View file

@ -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