mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-14 02:26:53 -07:00
added failed handling pass through
must specify new parameter "failed_fork" = 1 when using that version of SickBeard.
This commit is contained in:
parent
113dab58f3
commit
f44273484d
1 changed files with 19 additions and 7 deletions
|
@ -44,10 +44,6 @@ class AuthURLOpener(urllib.FancyURLopener):
|
|||
def processEpisode(dirName, nzbName=None, status=0):
|
||||
|
||||
status = int(status)
|
||||
if status > 0:
|
||||
print "the download failed. nothing to process"
|
||||
sys.exit()
|
||||
|
||||
config = ConfigParser.ConfigParser()
|
||||
configFilename = os.path.join(os.path.dirname(sys.argv[0]), "autoProcessTV.cfg")
|
||||
print "Loading config from", configFilename
|
||||
|
@ -77,14 +73,30 @@ def processEpisode(dirName, nzbName=None, status=0):
|
|||
web_root = config.get("SickBeard", "web_root")
|
||||
except ConfigParser.NoOptionError:
|
||||
web_root = ""
|
||||
|
||||
try:
|
||||
failed_fork = int(config.get("SickBeard", "failed_fork"))
|
||||
except (ConfigParser.NoOptionError, ValueError):
|
||||
failed_fork = 0
|
||||
|
||||
params = {}
|
||||
|
||||
params['quiet'] = 1
|
||||
|
||||
params['dir'] = dirName
|
||||
if nzbName != None:
|
||||
params['nzbName'] = nzbName
|
||||
#this is our default behaviour to work with the standard Master branch of SickBeard
|
||||
if failed_fork == 0:
|
||||
params['dir'] = dirName
|
||||
if nzbName != None:
|
||||
params['nzbName'] = nzbName
|
||||
# if you have specified you are using development branch from fork https://github.com/Tolstyak/Sick-Beard.git
|
||||
else:
|
||||
params['dirName'] = dirName
|
||||
if nzbName != None:
|
||||
params['nzbName'] = nzbName
|
||||
if status == 0:
|
||||
params['failed'] = False
|
||||
else:
|
||||
params['failed'] = True
|
||||
|
||||
myOpener = AuthURLOpener(username, password)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue