mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-21 13:53:15 -07:00
fix when fork not = auto.
This commit is contained in:
parent
3a4fe5223a
commit
6580480382
1 changed files with 15 additions and 11 deletions
|
@ -50,20 +50,17 @@ def autoFork(fork=None):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
fork = config.get(section, "fork")
|
fork = config.get(section, "fork")
|
||||||
if not fork in "auto":
|
|
||||||
fork = fork if fork in SICKBEARD_FAILED or fork in SICKBEARD_TORRENT else fork_default
|
|
||||||
fork = [f for f in forks.iteritems() if f[0] == fork][0]
|
|
||||||
except ConfigParser.NoOptionError:
|
except ConfigParser.NoOptionError:
|
||||||
fork = [f for f in forks.iteritems() if f[0] == fork_default][0]
|
fork = "auto"
|
||||||
|
|
||||||
myOpener = AuthURLOpener(username, password)
|
|
||||||
|
|
||||||
if ssl:
|
|
||||||
protocol = "https://"
|
|
||||||
else:
|
|
||||||
protocol = "http://"
|
|
||||||
|
|
||||||
if fork in "auto":
|
if fork in "auto":
|
||||||
|
myOpener = AuthURLOpener(username, password)
|
||||||
|
|
||||||
|
if ssl:
|
||||||
|
protocol = "https://"
|
||||||
|
else:
|
||||||
|
protocol = "http://"
|
||||||
|
|
||||||
Logger.info("Attempting to auto-detect SickBeard fork")
|
Logger.info("Attempting to auto-detect SickBeard fork")
|
||||||
for f in forks.iteritems():
|
for f in forks.iteritems():
|
||||||
url = protocol + host + ":" + port + web_root + "/home/postprocess/processEpisode?" + urllib.urlencode(f[1])
|
url = protocol + host + ":" + port + web_root + "/home/postprocess/processEpisode?" + urllib.urlencode(f[1])
|
||||||
|
@ -78,5 +75,12 @@ def autoFork(fork=None):
|
||||||
# failed to auto-detect fork
|
# failed to auto-detect fork
|
||||||
Logger.info("SickBeard fork auto-detection failed")
|
Logger.info("SickBeard fork auto-detection failed")
|
||||||
|
|
||||||
|
else: #if not fork in "auto"
|
||||||
|
try:
|
||||||
|
fork = fork if fork in SICKBEARD_FAILED or fork in SICKBEARD_TORRENT else fork_default
|
||||||
|
fork = [f for f in forks.iteritems() if f[0] == fork][0]
|
||||||
|
except:
|
||||||
|
fork = [f for f in forks.iteritems() if f[0] == fork_default][0]
|
||||||
|
|
||||||
Logger.info("SickBeard fork set to %s", fork[0])
|
Logger.info("SickBeard fork set to %s", fork[0])
|
||||||
return fork[0], fork[1]
|
return fork[0], fork[1]
|
Loading…
Add table
Add a link
Reference in a new issue