def Add( self, altname = None ): if altname is not None: resultingname = altname elif self.querychannelid == 0: resultingname = self.show + ' [' + self.channel + ']' else: resultingname = self.show infoLabels = { 'title' : resultingname, 'sorttitle' : resultingname.lower() } if self.channel.find( ',' ) == -1: icon = 'special://home/addons/' + self.plugin.addon_id + '/resources/icons/' + self.channel.lower() + '-m.png' else: icon = 'special://home/addons/' + self.plugin.addon_id + '/resources/icons/default-m.png' li = xbmcgui.ListItem( label = resultingname ) li.setInfo( type = 'video', infoLabels = infoLabels ) li.setArt( { 'thumb': icon, 'icon': icon } ) xbmcplugin.addDirectoryItem( handle = self.handle, url = mvutils.build_url( { 'mode': "films", 'show': self.id } ), listitem = li, isFolder = True )
def generate(self, databaseRs): # # 0 - channelid # 1 - channel # 2 - channel description xxx (#no) # # self.startTime = time.time() # xbmcplugin.addSortMethod(self.handle, xbmcplugin.SORT_METHOD_TITLE) xbmcplugin.setContent(self.handle, 'movies') # channelModel = Channel() listOfElements = [] for element in databaseRs: # channelModel.init(element[0], element[1], element[2]) # labelname = channelModel.channelCaption if channelModel.count > 0: labelname += ' (' + str(channelModel.count) + ')' # if self.plugin.get_kodi_version() > 17: list_item = xbmcgui.ListItem(label=labelname, offscreen=True) else: list_item = xbmcgui.ListItem(label=labelname) # icon = os.path.join(self.plugin.path, 'resources', 'icons', 'sender', channelModel.channelId.lower() + '-c.png') list_item.setArt({ 'thumb': icon, 'icon': icon, 'banner': icon, 'fanart': icon, 'clearart': icon, 'clearlogo': icon }) info_labels = { 'title': labelname, 'sorttitle': channelModel.channelCaption.lower() } list_item.setInfo(type='video', infoLabels=info_labels) # targetUrl = mvutils.build_url({ 'mode': self.targetUrl, 'channel': channelModel.channelId }) # listOfElements.append((targetUrl, list_item, True)) # xbmcplugin.addDirectoryItems(handle=self.handle, items=listOfElements, totalItems=len(listOfElements)) # xbmcplugin.endOfDirectory(self.handle, cacheToDisc=False) self.plugin.setViewId(self.plugin.resolveViewId('THUMBNAIL')) # self.logger.debug('generated: {} sec', time.time() - self.startTime)
def add(self, altname=None): """ Add the current entry to the directory Args: altname(str, optional): alternative name for the entry """ resultingname = self.channel if self.count == 0 else '%s (%d)' % ( self.channel, self.count, ) list_item = xbmcgui.ListItem( label=resultingname if altname is None else altname) icon = os.path.join(self.plugin.path, 'resources', 'icons', self.channel.lower() + '-m.png') list_item.setArt({'thumb': icon, 'icon': icon}) info_labels = { 'title': resultingname, 'sorttitle': resultingname.lower() } list_item.setInfo(type='video', infoLabels=info_labels) xbmcplugin.addDirectoryItem(handle=self.handle, url=mvutils.build_url({ 'mode': self.nextdir, 'channel': self.channelid }), listitem=list_item, isFolder=True)
def Add(self, altname=None): if altname is not None: resultingname = altname elif self.querychannelid == 0: resultingname = self.show + ' [' + self.channel + ']' else: resultingname = self.show infoLabels = { 'title': resultingname, 'sorttitle': resultingname.lower() } if self.channel.find(',') == -1: icon = 'special://home/addons/' + self.plugin.addon_id + '/resources/icons/' + self.channel.lower( ) + '-m.png' else: icon = 'special://home/addons/' + self.plugin.addon_id + '/resources/icons/default-m.png' li = xbmcgui.ListItem(label=resultingname) li.setInfo(type='video', infoLabels=infoLabels) li.setArt({'thumb': icon, 'icon': icon}) xbmcplugin.addDirectoryItem(handle=self.handle, url=mvutils.build_url({ 'mode': "films", 'show': self.id }), listitem=li, isFolder=True)
def add(self, altname=None): """ Add the current entry to the directory Args: altname(str, optional): alternative name for the entry """ resultingname = self.channel if self.count == 0 else '%s (%d)' % ( self.channel, self.count, ) list_item = xbmcgui.ListItem( label=resultingname if altname is None else altname) icon = 'special://home/addons/' + self.plugin.addon_id + \ '/resources/icons/' + self.channel.lower() + '-m.png' list_item.setArt({ 'thumb': icon, 'icon': icon }) xbmcplugin.addDirectoryItem( handle=self.handle, url=mvutils.build_url({ 'mode': self.nextdir, 'channel': self.channelid }), listitem=list_item, isFolder=True )
def add(self, altname=None): """ Add the current entry to the directory Args: altname(str, optional): alternative name for the entry """ if altname is None: resultingname = '%s (%d)' % (self.initial if self.initial != ' ' and self.initial != '' else ' No Title', self.count) else: resultingname = altname list_item = xbmcgui.ListItem(label=resultingname) info_labels = { 'title': resultingname, 'sorttitle': resultingname.lower() } list_item.setInfo(type='video', infoLabels=info_labels) xbmcplugin.addDirectoryItem(handle=self.handle, url=mvutils.build_url({ 'mode': "shows", 'channel': self.channelid, 'initial': self.initial, 'count': self.count }), listitem=list_item, isFolder=True)
def generate(self, databaseRs): # # 0 - letter # 1 - cnt # self.startTime = time.time() # xbmcplugin.addSortMethod(self.handle, xbmcplugin.SORT_METHOD_TITLE) xbmcplugin.setContent(self.handle, 'movies') # letterModel = Letter() listOfElements = [] for element in databaseRs: # letterModel.init(element[0], element[1]) nameLabel = letterModel.letter + " (" + str( letterModel.count) + ")" # if self.plugin.get_kodi_version() > 17: list_item = xbmcgui.ListItem(label=nameLabel, offscreen=True) else: list_item = xbmcgui.ListItem(label=nameLabel) # icon = os.path.join(self.plugin.path, 'resources', 'icons', 'letter', 'letter-' + letterModel.letter + '-m.png') list_item.setArt({ 'thumb': icon, 'icon': icon, 'banner': icon, 'fanart': icon, 'clearart': icon, 'clearlogo': icon }) # info_labels = {'title': nameLabel, 'sorttitle': nameLabel.lower()} list_item.setInfo(type='video', infoLabels=info_labels) # targetUrl = mvutils.build_url({ 'mode': 'shows', 'initial': letterModel.letter }) # listOfElements.append((targetUrl, list_item, True)) # xbmcplugin.addDirectoryItems(handle=self.handle, items=listOfElements, totalItems=len(listOfElements)) # xbmcplugin.endOfDirectory(self.handle, cacheToDisc=False) self.plugin.setViewId(self.plugin.resolveViewId('THUMBNAIL')) # self.logger.debug('generated: {} sec', time.time() - self.startTime)
def Add( self, altname = None ): resultingname = self.channel if self.count == 0 else '%s (%d)' % ( self.channel, self.count, ) li = xbmcgui.ListItem( label = resultingname if altname is None else altname ) icon = 'special://home/addons/' + self.plugin.addon_id + '/resources/icons/' + self.channel.lower() + '-m.png' li.setArt( { 'thumb': icon, 'icon': icon } ) xbmcplugin.addDirectoryItem( handle = self.handle, url = mvutils.build_url( { 'mode': self.nextdir, 'channel': self.id } ), listitem = li, isFolder = True )
def Add(self, altname=None): resultingname = self.channel if self.count == 0 else '%s (%d)' % ( self.channel, self.count, ) li = xbmcgui.ListItem( label=resultingname if altname is None else altname) icon = 'special://home/addons/' + self.plugin.addon_id + '/resources/icons/' + self.channel.lower( ) + '-m.png' li.setArt({'thumb': icon, 'icon': icon}) xbmcplugin.addDirectoryItem(handle=self.handle, url=mvutils.build_url({ 'mode': self.nextdir, 'channel': self.id }), listitem=li, isFolder=True)
def Add( self, altname = None ): if altname is None: resultingname = '%s (%d)' % ( self.initial if self.initial != ' ' and self.initial != '' else ' No Title', self.count ) else: resultingname = altname li = xbmcgui.ListItem( label = resultingname ) xbmcplugin.addDirectoryItem( handle = self.handle, url = mvutils.build_url( { 'mode': "shows", 'channel': self.channelid, 'initial': self.initial, 'count': self.count } ), listitem = li, isFolder = True )
def Add(self, altname=None): if altname is None: resultingname = '%s (%d)' % (self.initial if self.initial != ' ' and self.initial != '' else ' No Title', self.count) else: resultingname = altname li = xbmcgui.ListItem(label=resultingname) xbmcplugin.addDirectoryItem(handle=self.handle, url=mvutils.build_url({ 'mode': "shows", 'channel': self.channelid, 'initial': self.initial, 'count': self.count }), listitem=li, isFolder=True)
def add(self, altname=None): """ Add the current entry to the directory Args: altname(str, optional): alternative name for the entry """ if altname is not None: resultingname = altname elif self.querychannelid == 0: resultingname = self.show + ' [' + self.channel + ']' else: resultingname = self.show info_labels = { 'title': resultingname, 'sorttitle': resultingname.lower() } if self.channel.find(',') == -1: icon = 'special://home/addons/' + self.plugin.addon_id + \ '/resources/icons/' + self.channel.lower() + '-m.png' else: icon = 'special://home/addons/' + self.plugin.addon_id + \ '/resources/icons/default-m.png' list_item = xbmcgui.ListItem(label=resultingname) list_item.setInfo(type='video', infoLabels=info_labels) list_item.setArt({'thumb': icon, 'icon': icon}) xbmcplugin.addDirectoryItem(handle=self.handle, url=mvutils.build_url({ 'mode': "films", 'show': self.showid }), listitem=list_item, isFolder=True)
def generate(self, databaseRs): # # 0 - showid # 1 - channelId # 2 - showname # 3 - channel # self.startTime = time.time() # xbmcplugin.addSortMethod(self.handle, xbmcplugin.SORT_METHOD_TITLE) xbmcplugin.setContent(self.handle, '') # showModel = Show() listOfElements = [] for element in databaseRs: # showModel.init(element[0], element[1], element[2], element[3]) # if element[1].find(',') == -1: nameLabel = element[2] icon = os.path.join(self.plugin.path, 'resources', 'icons', 'sender', element[1].lower() + '-c.png') else: nameLabel = element[2] + ' [' + element[3] + ']' icon = os.path.join(self.plugin.path, 'resources', 'icons', 'default2-m.png') # if self.plugin.get_kodi_version() > 17: list_item = xbmcgui.ListItem(label=nameLabel, offscreen=True) else: list_item = xbmcgui.ListItem(label=nameLabel) # list_item.setArt({ 'thumb': icon, 'icon': icon, 'banner': icon, 'fanart': icon, 'clearart': icon, 'clearlogo': icon }) info_labels = {'title': nameLabel, 'sorttitle': nameLabel.lower()} list_item.setInfo(type='video', infoLabels=info_labels) # targetUrl = mvutils.build_url({ 'mode': 'films', 'channel': element[1].replace(',', '|'), 'show': element[0] }) # listOfElements.append((targetUrl, list_item, True)) # xbmcplugin.addDirectoryItems(handle=self.handle, items=listOfElements, totalItems=len(listOfElements)) # xbmcplugin.endOfDirectory(self.handle, cacheToDisc=False) self.plugin.setViewId(self.plugin.resolveViewId('SHOWS')) # self.logger.debug('generated: {} sec', time.time() - self.startTime)