def get_kodi_item(self): """ Creates an Kodi ListItem object for this channel :return: a Kodi ListItem with all required properties set. :rtype: xbmcgui.ListItem """ name = HtmlEntityHelper.convert_html_entities(self.channelName) description = HtmlEntityHelper.convert_html_entities( self.channelDescription) if self.uses_external_addon: from resources.lib.xbmcwrapper import XbmcWrapper name = "{} {}".format( name, XbmcWrapper.get_external_add_on_label(self.addonUrl)) self.icon = self.__get_image_path(self.icon) item = kodifactory.list_item(name, description) item.setArt({'thumb': self.icon, 'icon': self.icon}) # http://mirrors.kodi.tv/docs/python-docs/14.x-helix/xbmcgui.html#ListItem-setInfo item.setInfo( "video", { "Title": name, # "Count": self.sortOrderPerCountry, # "TrackNumber": self.sortOrder, "Genre": LanguageHelper.get_full_language(self.language), # "Tagline": description, "Plot": description }) if self.poster is not None: self.poster = self.__get_image_path(self.poster) item.setArt({'poster': self.poster}) if AddonSettings.hide_fanart(): return item if self.fanart is not None: self.fanart = self.__get_image_path(self.fanart) else: self.fanart = Config.fanart item.setArt({'fanart': self.fanart}) return item
def get_kodi_item(self): """ Creates an Kodi ListItem object for this channel :return: a Kodi ListItem with all required properties set. :rtype: xbmcgui.ListItem """ name = HtmlEntityHelper.convert_html_entities(self.channelName) description = HtmlEntityHelper.convert_html_entities( self.channelDescription) if self.uses_external_addon: other = LanguageHelper.get_localized_string( LanguageHelper.OtherAddon) name = "{0} {1} [COLOR gold]{2}[/COLOR]".format( name, unichr(187), other) self.icon = self.__get_image_path(self.icon) item = xbmcgui.ListItem(name, description) item.setArt({'thumb': self.icon, 'icon': self.icon}) # http://mirrors.kodi.tv/docs/python-docs/14.x-helix/xbmcgui.html#ListItem-setInfo item.setInfo( "video", { "Title": name, # "Count": self.sortOrderPerCountry, # "TrackNumber": self.sortOrder, "Genre": LanguageHelper.get_full_language(self.language), # "Tagline": description, "Plot": description }) if AddonSettings.hide_fanart(): return item if self.fanart is not None: self.fanart = self.__get_image_path(self.fanart) else: self.fanart = os.path.join(Config.rootDir, "fanart.jpg") item.setArt({'fanart': self.fanart}) return item