'calls the appropriate CMD class
looks for a cmd in args and kwargs
or calls the TVDBShorthandWrapper when the first args element is a number
or returns an error that there is no such cmd'

def call_dispatcher(self, *args, **kwargs):

    sickrage.srCore.srLogger.debug(((u"API    ::    all    args:    '" + str(args)) + u"'"))
    sickrage.srCore.srLogger.debug(((u"API    ::    all    kwargs:    '" + str(kwargs)) + u"'"))
    try:
        cmds = (kwargs.pop(u'cmd', (args[0] if len(args) else u'')).split(u'|') or [])
    except Exception as e:
        cmds = []
    outDict = {}
    multiCmds = bool((len(cmds) > 1))
    for cmd in cmds:
        (curArgs, curKwargs) = self.filter_params(cmd, *args, **kwargs)
        cmdIndex = None
        if (len(cmd.split(u'_')) > 1):
            (cmd, cmdIndex) = cmd.split(u'_')
        sickrage.srCore.srLogger.debug((((u'API    ::    ' + cmd) + u':    curKwargs    ') + str(curKwargs)))
        if (not (multiCmds and (cmd in (u'show.getbanner', u'show.getfanart', u'show.getnetworklogo', u'show.getposter')))):
            try:
                cmd = (cmd, (u'sr' + cmd[2:]))[(cmd[:2] == u'sb')]
                if (cmd in self.api_calls):
                    curOutDict = self.api_calls[cmd](self.application, self.request, *curArgs, **curKwargs).run()
                elif _is_int(cmd):
                    curOutDict = TVDBShorthandWrapper(cmd, self.application, self.request, *curArgs, **curKwargs).run()
                else:
                    curOutDict = _responds(RESULT_ERROR, ((u"No    such    cmd:    '" + cmd) + u"'"))
            except ApiError as e:
                curOutDict = _responds(RESULT_ERROR, msg=e.message)
        else:
            curOutDict = _responds(RESULT_ERROR, msg=((u"The    cmd    '" + cmd) + u"'    is    not    supported    while    chaining"))
        if multiCmds:
            if (cmdIndex is None):
                outDict[cmd] = curOutDict
            else:
                if (cmd not in outDict):
                    outDict[cmd] = {}
                outDict[cmd][cmdIndex] = curOutDict
            outDict = _responds(RESULT_SUCCESS, outDict)
        else:
            outDict = curOutDict
        return outDict
    return CMD_SiCKRAGE(*args, **kwargs).run()
