def rate_thumb(self, videoid): """Rate an item on Netflix. Ask for a thumb rating""" # Get updated user rating info for this videoid from resources.lib.api.paths import VIDEO_LIST_RATING_THUMB_PATHS video_list = api.custom_video_list([videoid.value], VIDEO_LIST_RATING_THUMB_PATHS) if video_list.videos: videoid_value, video_data = list(video_list.videos.items())[0] # pylint: disable=unused-variable title = video_data.get('title') track_id_jaw = video_data.get('trackIds', {})['trackId_jaw'] is_thumb_rating = video_data.get('userRating', {}).get('type', '') == 'thumb' user_rating = video_data.get('userRating', {}).get('userRating') \ if is_thumb_rating else None ui.show_modal_dialog(False, ui.xmldialogs.RatingThumb, 'plugin-video-netflix-RatingThumb.xml', g.ADDON.getAddonInfo('path'), videoid=videoid, title=title, track_id_jaw=track_id_jaw, user_rating=user_rating) else: common.warn( 'Rating thumb video list api request no got results for {}', videoid)
def exported(self, pathitems=None): """List all items that are exported to the Kodi library""" # pylint: disable=unused-argument library_contents = library.list_contents() if library_contents: listings.build_video_listing(api.custom_video_list(library_contents), g.MAIN_MENU_ITEMS['exported']) _handle_endofdirectory(self.dir_update_listing) else: ui.show_notification(common.get_local_string(30013)) xbmcplugin.endOfDirectory(g.PLUGIN_HANDLE, succeeded=False)