def community_to_listitem(self, community): name = community[Keys.NAME].encode('utf-8') display_name = community.get(Keys.DISPLAY_NAME) display_name = display_name.encode('utf-8') if display_name else name _id = community[Keys._ID] image = community.get(Keys.AVATAR_IMAGE, Images.THUMB) context_menu = list() context_menu.extend(menu_items.refresh()) context_menu.extend(menu_items.clear_previews()) context_menu.extend( menu_items.add_blacklist(_id, display_name, list_type='community')) return { 'label': display_name, 'path': kodi.get_plugin_url({ 'mode': MODES.COMMUNITYSTREAMS, 'community_id': _id }), 'art': the_art({ 'poster': image, 'thumb': image, 'icon': image }), 'context_menu': context_menu, 'info': self.get_plot_for_community(community) }
def team_to_listitem(team): name = team[Keys.NAME] background = team.get(Keys.BACKGROUND) if team.get( Keys.BACKGROUND) else Images.FANART image = team.get(Keys.LOGO) if team.get(Keys.LOGO) else Images.ICON context_menu = list() context_menu.extend(menu_items.refresh()) context_menu.extend(menu_items.clear_previews()) return { 'label': name, 'path': kodi.get_plugin_url({ 'mode': MODES.TEAMSTREAMS, 'team': name }), 'art': the_art({ 'fanart': background, 'poster': image, 'thumb': image, 'icon': image }), 'context_menu': context_menu }
def channel_to_listitem(self, channel): image = channel.get(Keys.LOGO) if channel.get(Keys.LOGO) else Images.ICON video_banner = channel.get(Keys.VIDEO_BANNER) if not video_banner: video_banner = channel.get(Keys.PROFILE_BANNER) if channel.get(Keys.PROFILE_BANNER) else Images.FANART context_menu = list() context_menu.extend(menu_items.refresh()) context_menu.extend(menu_items.clear_previews()) name = channel.get(Keys.DISPLAY_NAME) if channel.get(Keys.DISPLAY_NAME) else channel.get(Keys.NAME) if self.has_token: context_menu.extend(menu_items.edit_follow(channel[Keys._ID], name)) # context_menu.extend(menu_items.edit_block(channel[Keys._ID], name)) context_menu.extend(menu_items.add_blacklist(channel[Keys._ID], name)) return {'label': name, 'path': kodi.get_plugin_url({'mode': MODES.CHANNELVIDEOS, 'channel_id': channel[Keys._ID], 'channel_name': channel[Keys.NAME], 'display_name': name}), 'art': the_art({'fanart': video_banner, 'poster': image, 'thumb': image}), 'context_menu': context_menu, 'info': self.get_plot_for_channel(channel)}