From 261efe25d0249be9f388a54995072e4e55bc1164 Mon Sep 17 00:00:00 2001 From: echel0n Date: Wed, 17 Dec 2014 01:44:07 -0800 Subject: [PATCH] Fixed sickragetv/sickrage-issues#79 - kwargs where not being properly parsed from API class --- sickbeard/webapi.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sickbeard/webapi.py b/sickbeard/webapi.py index 30bae45d..f0025b2b 100644 --- a/sickbeard/webapi.py +++ b/sickbeard/webapi.py @@ -79,6 +79,10 @@ class ApiHandler(RequestHandler): def get(self, *args, **kwargs): kwargs = self.request.arguments + for arg, value in kwargs.items(): + if len(value) == 1: + kwargs[arg] = value[0] + args = args[1:] # set the output callback @@ -159,7 +163,8 @@ class ApiHandler(RequestHandler): del kwargs["cmd"] outDict = {} - if cmds != None: + if cmds is not None: + cmds = cmds.split("|") multiCmds = bool(len(cmds) > 1) for cmd in cmds: curArgs, curKwargs = self.filter_params(cmd, args, kwargs)