use category in autofork. fixes #306

This commit is contained in:
clinton-hall 2014-04-04 09:07:42 +10:30
commit 205f5d9383
3 changed files with 14 additions and 11 deletions

View file

@ -38,15 +38,15 @@ def main(inputDirectory, inputName, inputCategory, inputHash, inputID):
Logger.debug("MAIN: Determined Directory: %s | Name: %s | Category: %s", inputDirectory, inputName, inputCategory) Logger.debug("MAIN: Determined Directory: %s | Name: %s | Category: %s", inputDirectory, inputName, inputCategory)
sbFork, sbParams = autoFork() if inputCategory in sbCategory:
sbFork, sbParams = autoFork(inputCategory)
if inputCategory in sbCategory and sbFork in SICKBEARD_TORRENT and Torrent_NoLink == 1: if sbFork in SICKBEARD_TORRENT and Torrent_NoLink == 1:
Logger.info("MAIN: Calling SickBeard's %s branch to post-process: %s",sbFork ,inputName) Logger.info("MAIN: Calling SickBeard's %s branch to post-process: %s",sbFork ,inputName)
result = autoProcessTV.processEpisode(inputDirectory, inputName, int(0)) result = autoProcessTV.processEpisode(inputDirectory, inputName, int(0))
if result == 1: if result == 1:
Logger.info("MAIN: A problem was reported in the autoProcess* script.") Logger.info("MAIN: A problem was reported in the autoProcess* script.")
Logger.info("MAIN: All done.") Logger.info("MAIN: All done.")
sys.exit() sys.exit()
outputDestination = "" outputDestination = ""
for category in categories: for category in categories:

View file

@ -117,7 +117,7 @@ def processEpisode(dirName, nzbName=None, failed=False, clientAgent = "manual",
dirName = SpecificPath dirName = SpecificPath
# auto-detect fork type # auto-detect fork type
fork, params = autoFork() fork, params = autoFork(inputCategory)
if fork not in SICKBEARD_TORRENT or (clientAgent in ['nzbget','sabnzbd'] and nzbExtractionBy != "Destination"): if fork not in SICKBEARD_TORRENT or (clientAgent in ['nzbget','sabnzbd'] and nzbExtractionBy != "Destination"):
if nzbName: if nzbName:

View file

@ -24,10 +24,13 @@ class AuthURLOpener(urllib.FancyURLopener):
self.numTries = 0 self.numTries = 0
return urllib.FancyURLopener.open(self, url) return urllib.FancyURLopener.open(self, url)
def autoFork(): def autoFork(inputCategory = None):
# config settings # config settings
section = "SickBeard" section = "SickBeard"
if inputCategory != None and config().has_section(inputCategory):
section = inputCategory
host = config().get(section, "host") host = config().get(section, "host")
port = config().get(section, "port") port = config().get(section, "port")
username = config().get(section, "username") username = config().get(section, "username")