cleanup and a few fixes. #288

This commit is contained in:
clinton-hall 2014-03-21 21:55:00 +10:30
commit a9556dd7a0
5 changed files with 11 additions and 8 deletions

View file

@ -21,7 +21,7 @@ import autoProcess.autoProcessMovie as autoProcessMovie
import autoProcess.autoProcessTV as autoProcessTV
from autoProcess.nzbToMediaEnv import *
from autoProcess.nzbToMediaUtil import *
from autoSickBeardFork import autoFork
from autoProcess.autoSickBeardFork import autoFork
from utorrent.client import UTorrentClient
from transmissionrpc.client import Client as TransmissionClient
from synchronousdeluge.client import DelugeClient
@ -44,6 +44,8 @@ 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_ForceLink != 1:
Logger.info("MAIN: Calling SickBeard's %s branch to post-process: %s",sbFork ,inputName)
result = autoProcessTV.processEpisode(inputDirectory, inputName, int(0))
@ -490,7 +492,6 @@ if __name__ == "__main__":
cpsCategory = (config.get("CouchPotato", "cpsCategory")).split(',') # movie
sbCategory = (config.get("SickBeard", "sbCategory")).split(',') # tv
sbFork, sbParams = autoFork(config.get("SickBeard", "fork")) # default
Torrent_ForceLink = int(config.get("SickBeard", "Torrent_ForceLink")) # 1
hpCategory = (config.get("HeadPhones", "hpCategory")).split(',') # music
mlCategory = (config.get("Mylar", "mlCategory")).split(',') # comics

View file

@ -51,10 +51,10 @@ def autoFork(fork=None):
try:
fork = config.get(section, "fork")
if not fork in "auto":
fork = forks[fork] \
if fork in SICKBEARD_FAILED or SICKBEARD_TORRENT else forks[fork_default]
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:
fork = forks[fork_default]
fork = [f for f in forks.iteritems() if f[0] == fork_default][0]
myOpener = AuthURLOpener(username, password)

View file

@ -61,6 +61,8 @@ def migrate():
if option == "failed_fork": # change this old format
option = "fork"
value = "auto"
if option == "fork" and value in ["TPB", "TPB-failed", "Pistachitos"]: # Merge all these to "auto"
value = "auto"
if option == "outputDirectory": # move this to new location format
value = os.path.split(os.path.normpath(value))[0]
confignew.set("Torrent", option, value)

View file

@ -109,7 +109,7 @@
# SickBeard fork.
#
# set to default or auto to auto-detect the custom failed fork type".
# set to default or auto to auto-detect the custom fork type.
#sbfork=auto
# SickBeard Delete Failed Downloads (0, 1)

View file

@ -58,8 +58,8 @@
# SickBeard fork.
#
# set to default or TPB or failed if using the custom "TPB" or "failed fork".
#sbfork=default
# set to default or auto to auto-detect the custom fork type.
#sbfork=auto
# SickBeard Delete Failed Downloads (0, 1).
#