diff --git a/TorrentToMedia.py b/TorrentToMedia.py index cdf976df..038996de 100755 --- a/TorrentToMedia.py +++ b/TorrentToMedia.py @@ -38,15 +38,15 @@ def main(inputDirectory, inputName, inputCategory, inputHash, inputID): Logger.debug("MAIN: Determined Directory: %s | Name: %s | Category: %s", inputDirectory, inputName, inputCategory) - sbFork, sbParams = autoFork() - - if inputCategory in sbCategory and sbFork in SICKBEARD_TORRENT and Torrent_NoLink == 1: - Logger.info("MAIN: Calling SickBeard's %s branch to post-process: %s",sbFork ,inputName) - result = autoProcessTV.processEpisode(inputDirectory, inputName, int(0)) - if result == 1: - Logger.info("MAIN: A problem was reported in the autoProcess* script.") - Logger.info("MAIN: All done.") - sys.exit() + if inputCategory in sbCategory: + sbFork, sbParams = autoFork(inputCategory) + if sbFork in SICKBEARD_TORRENT and Torrent_NoLink == 1: + Logger.info("MAIN: Calling SickBeard's %s branch to post-process: %s",sbFork ,inputName) + result = autoProcessTV.processEpisode(inputDirectory, inputName, int(0)) + if result == 1: + Logger.info("MAIN: A problem was reported in the autoProcess* script.") + Logger.info("MAIN: All done.") + sys.exit() outputDestination = "" for category in categories: diff --git a/autoProcess/autoProcessTV.py b/autoProcess/autoProcessTV.py index 70163467..cc97499e 100644 --- a/autoProcess/autoProcessTV.py +++ b/autoProcess/autoProcessTV.py @@ -117,7 +117,7 @@ def processEpisode(dirName, nzbName=None, failed=False, clientAgent = "manual", dirName = SpecificPath # 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 nzbName: diff --git a/autoProcess/autoSickBeardFork.py b/autoProcess/autoSickBeardFork.py index c1aef3c9..b2d7decc 100644 --- a/autoProcess/autoSickBeardFork.py +++ b/autoProcess/autoSickBeardFork.py @@ -24,10 +24,13 @@ class AuthURLOpener(urllib.FancyURLopener): self.numTries = 0 return urllib.FancyURLopener.open(self, url) -def autoFork(): +def autoFork(inputCategory = None): # config settings section = "SickBeard" + if inputCategory != None and config().has_section(inputCategory): + section = inputCategory + host = config().get(section, "host") port = config().get(section, "port") username = config().get(section, "username")