mirror of
https://github.com/moparisthebest/SickRage
synced 2025-01-07 11:58:01 -05:00
Fixed issue #1105, WebAPI
This commit is contained in:
parent
467c42747f
commit
0494f6f76c
@ -71,7 +71,7 @@ result_type_map = {RESULT_SUCCESS: "success",
|
|||||||
|
|
||||||
class ApiHandler(RequestHandler):
|
class ApiHandler(RequestHandler):
|
||||||
""" api class that returns json results """
|
""" api class that returns json results """
|
||||||
version = 4 # use an int since float-point is unpredictible
|
version = 5 # use an int since float-point is unpredictible
|
||||||
intent = 4
|
intent = 4
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
@ -79,6 +79,7 @@ class ApiHandler(RequestHandler):
|
|||||||
|
|
||||||
def get(self, *args, **kwargs):
|
def get(self, *args, **kwargs):
|
||||||
kwargs = self.request.arguments
|
kwargs = self.request.arguments
|
||||||
|
args = args[1:]
|
||||||
|
|
||||||
# set the output callback
|
# set the output callback
|
||||||
# default json
|
# default json
|
||||||
@ -123,9 +124,6 @@ class ApiHandler(RequestHandler):
|
|||||||
else:
|
else:
|
||||||
outputCallback = outputCallbackDict['default']
|
outputCallback = outputCallbackDict['default']
|
||||||
|
|
||||||
if not len(outDict) > 0:
|
|
||||||
outDict = _responds(RESULT_SUCCESS, msg=accessMsg)
|
|
||||||
|
|
||||||
return self.finish(outputCallback(outDict))
|
return self.finish(outputCallback(outDict))
|
||||||
|
|
||||||
def _out_as_json(self, dict):
|
def _out_as_json(self, dict):
|
||||||
@ -1377,7 +1375,7 @@ class CMD_SickBeard(ApiCall):
|
|||||||
|
|
||||||
def run(self):
|
def run(self):
|
||||||
""" display misc sickrage related information """
|
""" display misc sickrage related information """
|
||||||
data = {"sb_version": sickbeard.BRANCH, "api_version": self.version,
|
data = {"sr_version": sickbeard.BRANCH, "api_version": self.version,
|
||||||
"api_commands": sorted(_functionMaper.keys())}
|
"api_commands": sorted(_functionMaper.keys())}
|
||||||
return _responds(RESULT_SUCCESS, data)
|
return _responds(RESULT_SUCCESS, data)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user