def add_items(self, iterable, is_update=False, sort_method_ids=[], override_view_mode=False): items = [] urls = [] for i, li_info in enumerate(iterable): items.append( self._make_listitem(**li_info) ) if self._mode in ['crawl', 'interactive']: print '[%d] %s%s%s (%s)' % (i + 1, '', li_info.get('label'), '', li_info.get('url')) urls.append(li_info.get('url')) if self._mode is 'xbmc': if override_view_mode: skin = xbmc.getSkinDir() thumbnail_view = THUMBNAIL_VIEW_IDS.get(skin) if thumbnail_view: cmd = 'Container.SetViewMode(%s)' % thumbnail_view xbmc.executebuiltin(cmd) xbmcplugin.addDirectoryItems(self.handle, items, len(items)) for id in sort_method_ids: xbmcplugin.addSortMethod(self.handle, id) xbmcplugin.endOfDirectory(self.handle, updateListing=is_update) return urls
def add_items(self, iterable, is_update=False, sort_method_ids=[], override_view_mode=False): items = [] urls = [] for i, li_info in enumerate(iterable): items.append(self._make_listitem(**li_info)) if self._mode in ['crawl', 'interactive', 'test']: print '[%d] %s%s%s (%s)' % (i + 1, '', li_info.get('label'), '', li_info.get('url')) urls.append(li_info.get('url')) if self._mode is 'xbmc': if override_view_mode: skin = xbmc.getSkinDir() thumbnail_view = THUMBNAIL_VIEW_IDS.get(skin) if thumbnail_view: cmd = 'Container.SetViewMode(%s)' % thumbnail_view xbmc.executebuiltin(cmd) xbmcplugin.addDirectoryItems(self.handle, items, len(items)) for id in sort_method_ids: xbmcplugin.addSortMethod(self.handle, id) xbmcplugin.endOfDirectory(self.handle, updateListing=is_update) return urls
def show_homepage(): skin_used = xbmc.getSkinDir() if skin_used == 'skin.confluence': xbmc.executebuiltin('Container.SetViewMode(500)') # "Thumbnail" view elif skin_used == 'skin.aeon.nox': xbmc.executebuiltin('Container.SetViewMode(512)') # "Info-wall" view. if usern != '': items = [ # SD Live { 'label': plugin.get_string(30100), 'thumbnail': 'http://195.222.33.193/kodi/livetv.png', 'url': plugin.url_for('show_live', label='sd') }, # Live cam { 'label': plugin.get_string(30101), 'thumbnail': 'http://195.222.33.193/kodi/cam.png', 'url': plugin.url_for('show_live', label='cam') }, # Radio { 'label': plugin.get_string(30102), 'thumbnail': 'http://195.222.33.193/kodi/radio.png', 'url': plugin.url_for('show_live', label='radio') }, # Recordings { 'label': plugin.get_string(30103), 'thumbnail': 'http://195.222.33.193/kodi/rec.png', 'url': plugin.url_for('show_live', label='rec') }, ] if usern == '': items = [ # Live cam { 'label': plugin.get_string(30101), 'thumbnail': 'http://195.222.33.193/kodi/cam.png', 'url': plugin.url_for('show_live', label='cam') }, # Radio { 'label': plugin.get_string(30102), 'thumbnail': 'http://195.222.33.193/kodi/radio.png', 'url': plugin.url_for('show_live', label='radio') }, ] return plugin.add_items(items)
def add_items(self, iterable, is_update=False, sort_method_ids=[], override_view_mode=False): items = [] urls = [] for i, li_info in enumerate(iterable): items.append(self._make_listitem(**li_info)) if self._mode in ['crawl', 'interactive', 'test']: print '[%d] %s%s%s (%s)' % (i + 1, '', li_info.get('label'), '', li_info.get('url')) urls.append(li_info.get('url')) if self._mode is 'xbmc': self.set_content('movies') xbmcplugin.addDirectoryItems(self.handle, items, len(items)) for id in sort_method_ids: xbmcplugin.addSortMethod(self.handle, id) if override_view_mode: if xbmc.getSkinDir() == 'skin.confluence': xbmc.executebuiltin('Container.SetViewMode(504)') xbmcplugin.endOfDirectory(self.handle, updateListing=is_update) return urls
def add_items(self, iterable, is_update=False, sort_method_ids=[], override_view_mode=True): items = [] urls = [] for i, li_info in enumerate(iterable): items.append(self._make_listitem(**li_info)) if self._mode in ["crawl", "interactive", "test"]: print "[%d] %s%s%s (%s)" % (i + 1, "", li_info.get("label"), "", li_info.get("url")) urls.append(li_info.get("url")) if self._mode is "xbmc": if override_view_mode: skin = xbmc.getSkinDir() thumbnail_view = THUMBNAIL_VIEW_IDS.get(skin) if thumbnail_view: cmd = "Container.SetViewMode(%s)" % thumbnail_view xbmc.executebuiltin(cmd) xbmcplugin.addDirectoryItems(self.handle, items, len(items)) for id in sort_method_ids: xbmcplugin.addSortMethod(self.handle, id) xbmcplugin.endOfDirectory(self.handle, updateListing=is_update) return urls
def show_homepage(): skin_used = xbmc.getSkinDir() if skin_used == 'skin.confluence': xbmc.executebuiltin('Container.SetViewMode(500)') # "Thumbnail" view elif skin_used == 'skin.aeon.nox': xbmc.executebuiltin('Container.SetViewMode(512)') # "Info-wall" view. if usern!='': items = [ # SD Live {'label': plugin.get_string(30100), 'thumbnail': 'http://webtv.bhtelecom.ba/kodi/livetv.png', 'url': plugin.url_for('show_live', label='sd')}, # Live cam {'label': plugin.get_string(30101), 'thumbnail': 'http://webtv.bhtelecom.ba/kodi/cam.png', 'url': plugin.url_for('show_live', label='cam')}, # Radio {'label': plugin.get_string(30102), 'thumbnail': 'http://webtv.bhtelecom.ba/kodi/radio.png', 'url': plugin.url_for('show_live', label='radio')}, # Recordings {'label': plugin.get_string(30103), 'thumbnail': 'http://webtv.bhtelecom.ba/kodi/rec.png', 'url': plugin.url_for('show_live', label='rec')}, ] if usern=='': items = [ # Live cam {'label': plugin.get_string(30101), 'thumbnail': 'http://webtv.bhtelecom.ba/kodi/cam.png', 'url': plugin.url_for('show_live', label='cam')}, # Radio {'label': plugin.get_string(30102), 'thumbnail': 'http://webtv.bhtelecom.ba/kodi/radio.png', 'url': plugin.url_for('show_live', label='radio')}, ] return plugin.add_items(items)