def route(pathitems): """Route to the appropriate handler""" common.debug('Routing navigation request') root_handler = pathitems[0] if pathitems else g.MODE_DIRECTORY if root_handler == g.MODE_PLAY: player.play(pathitems=pathitems[1:]) elif root_handler == 'extrafanart': common.debug('Ignoring extrafanart invocation') xbmcplugin.endOfDirectory(handle=g.PLUGIN_HANDLE, succeeded=False) elif root_handler not in NAV_HANDLERS: raise nav.InvalidPathError('No root handler for path {}'.format( '/'.join(pathitems))) else: nav.execute(NAV_HANDLERS[root_handler], pathitems[1:], g.REQUEST_PARAMS)
def route(pathitems): """Route to the appropriate handler""" LOG.debug('Routing navigation request') root_handler = pathitems[0] if pathitems else G.MODE_DIRECTORY if root_handler == G.MODE_PLAY: from resources.lib.navigation.player import play play(videoid=pathitems[1:]) elif root_handler == G.MODE_PLAY_STRM: from resources.lib.navigation.player import play_strm play_strm(videoid=pathitems[1:]) elif root_handler == 'extrafanart': LOG.warn('Route: ignoring extrafanart invocation') return False else: nav_handler = _get_nav_handler(root_handler, pathitems) _execute(nav_handler, pathitems[1:], G.REQUEST_PARAMS) return True
def route(pathitems): """Route to the appropriate handler""" debug('Routing navigation request') root_handler = pathitems[0] if pathitems else g.MODE_DIRECTORY if root_handler == g.MODE_PLAY: from resources.lib.navigation.player import play play(videoid=pathitems[1:]) return if root_handler == 'extrafanart': warn('Route: ignoring extrafanart invocation') _handle_endofdirectory() return nav_handler = _get_nav_handler(root_handler) if not nav_handler: from resources.lib.api.exceptions import InvalidPathError raise InvalidPathError('No root handler for path {}'.format( '/'.join(pathitems))) _execute(nav_handler, pathitems[1:], g.REQUEST_PARAMS)
def route(pathitems): """Route to the appropriate handler""" debug('Routing navigation request') root_handler = pathitems[0] if pathitems else G.MODE_DIRECTORY if root_handler == G.MODE_PLAY: from resources.lib.navigation.player import play play(videoid=pathitems[1:]) elif root_handler == G.MODE_PLAY_STRM: from resources.lib.navigation.player import play_strm play_strm(videoid=pathitems[1:]) elif root_handler == 'extrafanart': warn('Route: ignoring extrafanart invocation') return False else: nav_handler = _get_nav_handler(root_handler) if not nav_handler: raise InvalidPathError('No root handler for path {}'.format( '/'.join(pathitems))) _execute(nav_handler, pathitems[1:], G.REQUEST_PARAMS) return True