return True return False def __play_action(params, processed): """ Play an item :param params: Route paramters :type params: dict :param processed: Other route already matched :type processed: bool :returns: bool -- Route matched """ video_id = params.get('video_id') if video_id is not None and processed is False: CONTENT_LOADER.play(video_id=video_id) return True return False if __name__ == '__main__': # Load addon data & start plugin ADDON = UTILS.get_addon() ADDON_DATA = UTILS.get_addon_data() UTILS.log('Started (Version {0})'.format(ADDON_DATA.get('version'))) # Call the router function and pass # the plugin call parameters to it. # We use string slicing to trim the # leading '?' from the plugin call paramstring router(argv[2][1:])
:param params: Route paramters :type params: dict :param processed: Other route already matched :type processed: bool :returns: bool -- Route matched """ video_id = params.get('video_id') if video_id is not None and processed is False: CONTENT_LOADER.play(video_id=video_id) return True return False if __name__ == '__main__': # Load addon data & start plugin ADDON = UTILS.get_addon() ADDON_DATA = UTILS.get_addon_data() UTILS.log('Started (Version ' + ADDON_DATA.get('version') + ')') # show user settings dialog if settings are not complete # store the credentials if user added them if SETTINGS.has_credentials(): USER, PASSWORD = SETTINGS.get_credentials() else: USER, PASSWORD = SETTINGS.set_credentials() # Call the router function and pass # the plugin call parameters to it. # We use string slicing to trim the # leading '?' from the plugin call paramstring router(argv[2][1:], user=USER, password=PASSWORD)