fix CP server responding test. Add trailing /. Fixes #1193

This commit is contained in:
clinton-hall 2017-02-13 19:44:01 +10:30
commit d34e06e42b

View file

@ -20,13 +20,13 @@ class autoProcessMovie(object):
# determine cmd and params to send to CouchPotato to get our results # determine cmd and params to send to CouchPotato to get our results
section = 'movies' section = 'movies'
cmd = "/media.list" cmd = "media.list"
if release_id or imdbid: if release_id or imdbid:
section = 'media' section = 'media'
cmd = "/media.get" cmd = "media.get"
params['id'] = release_id or imdbid params['id'] = release_id or imdbid
url = baseURL + cmd url = "{0}{1}".format(baseURL, cmd)
logger.debug("Opening URL: {0} with PARAMS: {1}".format(url, params)) logger.debug("Opening URL: {0} with PARAMS: {1}".format(url, params))
try: try:
@ -124,7 +124,7 @@ class autoProcessMovie(object):
extract = int(cfg.get("extract", 0)) extract = int(cfg.get("extract", 0))
imdbid = find_imdbid(dirName, inputName) imdbid = find_imdbid(dirName, inputName)
baseURL = "{0}{1}:{2}{3}/api/{4}".format(protocol, host, port, web_root, apikey) baseURL = "{0}{1}:{2}{3}/api/{4}/".format(protocol, host, port, web_root, apikey)
if not apikey: if not apikey:
logger.info('No CouchPotato apikey entered. Performing transcoder functions only') logger.info('No CouchPotato apikey entered. Performing transcoder functions only')
release = None release = None
@ -226,10 +226,10 @@ class autoProcessMovie(object):
params['media_folder'] = remoteDir(dirName) if remote_path else dirName params['media_folder'] = remoteDir(dirName) if remote_path else dirName
if method == "manage": if method == "manage":
command = "/manage.update" command = "manage.update"
params = {} params = {}
else: else:
command = "/renamer.scan" command = "renamer.scan"
url = "{0}{1}".format(baseURL, command) url = "{0}{1}".format(baseURL, command)
@ -274,7 +274,7 @@ class autoProcessMovie(object):
if release_id: if release_id:
logger.postprocess("Setting failed release {0} to ignored ...".format(inputName), section) logger.postprocess("Setting failed release {0} to ignored ...".format(inputName), section)
url = "{url}/release.ignore".format(url=baseURL) url = "{url}release.ignore".format(url=baseURL)
params = {'id': release_id} params = {'id': release_id}
logger.debug("Opening URL: {0} with PARAMS: {1}".format(url, params), section) logger.debug("Opening URL: {0} with PARAMS: {1}".format(url, params), section)
@ -297,7 +297,7 @@ class autoProcessMovie(object):
logger.postprocess("Trying to snatch the next highest ranked release.", section) logger.postprocess("Trying to snatch the next highest ranked release.", section)
url = "{0}/movie.searcher.try_next".format(baseURL) url = "{0}movie.searcher.try_next".format(baseURL)
logger.debug("Opening URL: {0}".format(url), section) logger.debug("Opening URL: {0}".format(url), section)
try: try: