From a0d3a790dc59dacc2ff01ab853b6c6413f35fa12 Mon Sep 17 00:00:00 2001 From: echel0n Date: Thu, 20 Mar 2014 18:01:26 -0700 Subject: [PATCH] Added auto-detection of directory paramater for external post-processing calls for 3rd-party utils such as nzbToMedia where you can specify what fork you are using to setup what paramaters are required to be used, this takes the headache out of it --- sickbeard/webserve.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/sickbeard/webserve.py b/sickbeard/webserve.py index 36af98e7..109a2b29 100644 --- a/sickbeard/webserve.py +++ b/sickbeard/webserve.py @@ -1848,8 +1848,8 @@ class HomePostProcess: @cherrypy.expose def processEpisode(self, dir=None, dirName=None, nzbName=None, jobName=None, quiet=None, process_method=None, force=None, is_priority=None, failed="0", type="auto", indexer="auto"): - # backwards compatibility for original param 'dirName' that has been renamed to 'dir' - if dirName and dir is None: dir = dirName + # auto-detect dirParam style + dirParam = dir if dir is not None else dirName if not None else redirect("/home/postprocess/") if failed == "0": failed = False @@ -1866,15 +1866,12 @@ class HomePostProcess: else: is_priority = False - if not dir: - redirect("/home/postprocess/") - else: - result = processTV.processDir(dir, nzbName, process_method=process_method, force=force, is_priority=is_priority, failed=failed, type=type, indexer=indexer) - if quiet != None and int(quiet) == 1: - return result + result = processTV.processDir(dirParam, nzbName, process_method=process_method, force=force, is_priority=is_priority, failed=failed, type=type, indexer=indexer) + if quiet != None and int(quiet) == 1: + return result - result = result.replace("\n","
\n") - return _genericMessage("Postprocessing results", result) + result = result.replace("\n","
\n") + return _genericMessage("Postprocessing results", result) class NewHomeAddShows: