added Torrent label to userscript options. fixes #262

This commit is contained in:
clinton-hall 2014-02-16 10:46:59 +10:30
parent 4c68fd2fd9
commit 93f2f75cdc
2 changed files with 7 additions and 4 deletions

View file

@ -251,7 +251,7 @@ def main(inputDirectory, inputName, inputCategory, inputHash, inputID):
if (inputCategory in user_script_categories and not "NONE" in user_script_categories) or ("ALL" in user_script_categories and not inputCategory in processCategories): if (inputCategory in user_script_categories and not "NONE" in user_script_categories) or ("ALL" in user_script_categories and not inputCategory in processCategories):
Logger.info("MAIN: Processing user script %s.", user_script) Logger.info("MAIN: Processing user script %s.", user_script)
result = external_script(outputDestination,inputName) result = external_script(outputDestination,inputName,inputCategory)
elif status == int(0) or (inputCategory in hpCategory + mlCategory + gzCategory): # if movies linked/extracted or for other categories. elif status == int(0) or (inputCategory in hpCategory + mlCategory + gzCategory): # if movies linked/extracted or for other categories.
Logger.debug("MAIN: Calling autoProcess script for successful download.") Logger.debug("MAIN: Calling autoProcess script for successful download.")
status = int(0) # hp, my, gz don't support failed. status = int(0) # hp, my, gz don't support failed.
@ -343,7 +343,7 @@ def main(inputDirectory, inputName, inputCategory, inputHash, inputID):
Logger.debug("media/meta file found: %s", item) Logger.debug("media/meta file found: %s", item)
Logger.info("MAIN: All done.") Logger.info("MAIN: All done.")
def external_script(outputDestination,torrentName): def external_script(outputDestination,torrentName,torrentLabel):
final_result = int(0) # start at 0. final_result = int(0) # start at 0.
num_files = int(0) num_files = int(0)
@ -368,6 +368,9 @@ def external_script(outputDestination,torrentName):
elif param == "TN": elif param == "TN":
command.append(torrentName) command.append(torrentName)
continue continue
elif param == "TL":
command.append(torrentLabel)
continue
elif param == "DN": elif param == "DN":
if user_script_runOnce == 1: if user_script_runOnce == 1:
command.append(outputDestination) command.append(outputDestination)

View file

@ -151,8 +151,8 @@ user_script_mediaExtensions = .mkv,.avi,.divx,.xvid,.mov,.wmv,.mp4,.mpg,.mpeg
#Specify the path of the script #Specify the path of the script
user_script_path = /media/test/script/script.sh user_script_path = /media/test/script/script.sh
#Specify the argument(s) passed to script, comma separated in order. #Specify the argument(s) passed to script, comma separated in order.
#for example FP,FN,DN, TN for file path (absolute file name with path), file name, absolute directory name (with path), TorrentName. #for example FP,FN,DN, TN, TL for file path (absolute file name with path), file name, absolute directory name (with path), Torrent Name, Torrent Label/Category.
#So the result is /media/test/script/script.sh FP FN DN TN. Add other arguments as needed eg -f, -r #So the result is /media/test/script/script.sh FP FN DN TN TL. Add other arguments as needed eg -f, -r
user_script_param = FN user_script_param = FN
#Set user_script_runOnce = 0 to run for each file, or 1 to only run once (presumably on teh entire directory). #Set user_script_runOnce = 0 to run for each file, or 1 to only run once (presumably on teh entire directory).
user_script_runOnce = 0 user_script_runOnce = 0