Python xbmcplugin.SORT_METHOD_TITLE Examples
The following are 14
code examples of xbmcplugin.SORT_METHOD_TITLE().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
xbmcplugin
, or try the search function
.
Example #1
Source File: plugin_content.py From plugin.audio.spotify with GNU General Public License v3.0 | 6 votes |
def browse_album(self): xbmcplugin.setContent(self.addon_handle, "songs") album = self.sp.album(self.albumid, market=self.usercountry) xbmcplugin.setProperty(self.addon_handle, 'FolderName', album["name"]) tracks = self.get_album_tracks(album) if album.get("album_type") == "compilation": self.add_track_listitems(tracks, True) else: self.add_track_listitems(tracks) xbmcplugin.addSortMethod(self.addon_handle, xbmcplugin.SORT_METHOD_UNSORTED) xbmcplugin.addSortMethod(self.addon_handle, xbmcplugin.SORT_METHOD_TRACKNUM) xbmcplugin.addSortMethod(self.addon_handle, xbmcplugin.SORT_METHOD_TITLE) xbmcplugin.addSortMethod(self.addon_handle, xbmcplugin.SORT_METHOD_VIDEO_YEAR) xbmcplugin.addSortMethod(self.addon_handle, xbmcplugin.SORT_METHOD_SONG_RATING) xbmcplugin.addSortMethod(self.addon_handle, xbmcplugin.SORT_METHOD_ARTIST) xbmcplugin.endOfDirectory(handle=self.addon_handle) if self.defaultview_songs: xbmc.executebuiltin('Container.SetViewMode(%s)' % self.defaultview_songs)
Example #2
Source File: filmui.py From plugin.video.mediathekview with MIT License | 6 votes |
def __init__(self, plugin, sortmethods=None): Film.__init__(self) self.plugin = plugin self.handle = plugin.addon_handle self.settings = Settings() # define sortmethod for films # all av. sort method and put the default sortmethod on first place to be used by UI allSortMethods = [ xbmcplugin.SORT_METHOD_TITLE, xbmcplugin.SORT_METHOD_DATE, xbmcplugin.SORT_METHOD_DATEADDED, xbmcplugin.SORT_METHOD_SIZE, xbmcplugin.SORT_METHOD_DURATION ] if sortmethods is not None: self.sortmethods = sortmethods else: method = allSortMethods[0] allSortMethods[0] = allSortMethods[self.settings.filmSortMethod] allSortMethods[self.settings.filmSortMethod]=method self.sortmethods = allSortMethods self.showshows = False self.showchannels = False
Example #3
Source File: default.py From ru with GNU General Public License v2.0 | 6 votes |
def mainScreen(params): link='http://manga24.ru/all/' http = GET(link) if http == None: return False beautifulSoup = BeautifulSoup(http) content = beautifulSoup.find('select', attrs={'id': 'manga_list'}) cats=content.findAll('option') for manga in cats: try: manga.prettify() title=manga.string path=str(manga).split('"')[1] listitem=xbmcgui.ListItem(title,addon_icon,addon_icon) listitem.setProperty('IsPlayable', 'false') listitem.setLabel(title) uri = construct_request({ 'func': 'get_manga', 'm_path':path }) xbmcplugin.addDirectoryItem(hos, uri, listitem, True) except: pass #xbmcplugin.addSortMethod(hos, xbmcplugin.SORT_METHOD_LABEL) #xbmcplugin.addSortMethod(hos, xbmcplugin.SORT_METHOD_TITLE) xbmcplugin.endOfDirectory(handle=hos, succeeded=True, updateListing=False, cacheToDisc=True)
Example #4
Source File: plugin_content.py From plugin.audio.spotify with GNU General Public License v3.0 | 5 votes |
def artist_toptracks(self): xbmcplugin.setContent(self.addon_handle, "songs") xbmcplugin.setProperty(self.addon_handle, 'FolderName', self.addon.getLocalizedString(11011)) tracks = self.sp.artist_top_tracks(self.artistid, country=self.usercountry) tracks = self.prepare_track_listitems(tracks=tracks["tracks"]) self.add_track_listitems(tracks) xbmcplugin.addSortMethod(self.addon_handle, xbmcplugin.SORT_METHOD_UNSORTED) xbmcplugin.addSortMethod(self.addon_handle, xbmcplugin.SORT_METHOD_TRACKNUM) xbmcplugin.addSortMethod(self.addon_handle, xbmcplugin.SORT_METHOD_TITLE) xbmcplugin.addSortMethod(self.addon_handle, xbmcplugin.SORT_METHOD_VIDEO_YEAR) xbmcplugin.addSortMethod(self.addon_handle, xbmcplugin.SORT_METHOD_SONG_RATING) xbmcplugin.endOfDirectory(handle=self.addon_handle) if self.defaultview_songs: xbmc.executebuiltin('Container.SetViewMode(%s)' % self.defaultview_songs)
Example #5
Source File: plugin_content.py From plugin.audio.spotify with GNU General Public License v3.0 | 5 votes |
def browse_savedartists(self): xbmcplugin.setContent(self.addon_handle, "artists") xbmcplugin.setProperty(self.addon_handle, 'FolderName', xbmc.getLocalizedString(133)) artists = self.get_savedartists() self.add_artist_listitems(artists) xbmcplugin.addSortMethod(self.addon_handle, xbmcplugin.SORT_METHOD_TITLE) xbmcplugin.endOfDirectory(handle=self.addon_handle) if self.defaultview_artists: xbmc.executebuiltin('Container.SetViewMode(%s)' % self.defaultview_artists)
Example #6
Source File: default.py From kodi with GNU General Public License v3.0 | 5 votes |
def parse(self, data, url = '', page = 0, filter = None): content = common.parseDOM(data, "div", attrs={"id": "dle-content"}) pagenav = common.parseDOM(data, "div", attrs={"class": "bot-navigation"}) boxes = common.parseDOM(content, "div", attrs={"class": "all_tv"}) links = common.parseDOM(boxes, "a", ret='href') titles = common.parseDOM(boxes, "a", ret='title') if not titles: titles = common.parseDOM(content, "div", attrs={"class": "all_tv"}, ret='title') images = common.parseDOM(boxes, "img", ret='src') items = 0 for i, title in enumerate(titles): if (not filter) or (title[:len(filter)].upper() == filter.upper()): items += 1 if links[i] == "http://tivix.co/263-predlozheniya-pozhelaniya-zamechaniya-po-saytu.html": continue image = self.url + images[i] uri = sys.argv[0] + '?mode=show&url=%s&name=%s&image=%s' % (links[i], title, image) item = xbmcgui.ListItem(title, iconImage=image, thumbnailImage=image) item.setInfo(type='Video', infoLabels={'title': title, 'plot': title}) #item.setProperty('IsPlayable', 'true') xbmcplugin.addDirectoryItem(self.handle, uri, item, True) if pagenav and (not (items < 119)): uri = sys.argv[0] + '?mode=%s&url=%s&page=%s' % ("index", url, str(int(page) + 1)) item = xbmcgui.ListItem('%s' % self.language(1003), iconImage=self.icon, thumbnailImage=self.icon) item.setInfo(type='Video', infoLabels={'title': 'ЯЯЯЯЯЯЯЯЯЯЯЯЯЯЯЯЯЯЯЯЯЯЯЯЯЯЯЯЯЯЯЯЯЯ'}) xbmcplugin.addDirectoryItem(self.handle, uri, item, True) xbmcplugin.addSortMethod(self.handle, xbmcplugin.SORT_METHOD_TITLE) xbmcplugin.setContent(self.handle, 'tvshows') xbmcplugin.endOfDirectory(self.handle, True)
Example #7
Source File: default.py From kodi with GNU General Public License v3.0 | 5 votes |
def getEPG(self, cid = None, cname = None, image = ''): currname = '' duration = 0 listItems = [] try: if cname: if cid: epgbody = self.epg[cid]['epg'] currname, duration, listItems = self.addEPGItems(epgbody, image) elif cid: epgbody = self.epg[cid]['epg'] currname, duration, listItems = self.addEPGItems(epgbody, image) xbmcplugin.addDirectoryItems(self.handle, listItems) else: for channelid in self.epg: channelbody = self.epg[channelid] uri = sys.argv[0] + '?mode=epg&cid=%s&image=%s' % (channelid, channelbody['image_url']) item = xbmcgui.ListItem("%s" % channelbody['title'], iconImage=channelbody['image_url'], thumbnailImage=channelbody['image_url']) item.setInfo(type='Video', infoLabels={'title': channelbody['title']}) commands = [] uricmd = sys.argv[0] + '?mode=show&url=%s&name=%s&image=%s' % (self.url + "/" + channelid + "-" + channelbody['alt_name'] + ".html", channelbody['title'], channelbody['image_url']) commands.append(('[COLOR=FF00FF00]' + self.language(1006) + '[/COLOR]', "Container.Update(%s)" % (uricmd), )) item.addContextMenuItems(commands) xbmcplugin.addDirectoryItem(self.handle, uri, item, True) xbmcplugin.addSortMethod(self.handle, xbmcplugin.SORT_METHOD_TITLE) except: pass if cname == None: xbmcplugin.setContent(self.handle, 'files') xbmcplugin.endOfDirectory(self.handle, True) return currname, duration, listItems
Example #8
Source File: showui.py From plugin.video.mediathekview with MIT License | 5 votes |
def __init__(self, plugin, sortmethods=None): super(ShowUI, self).__init__() self.plugin = plugin self.handle = plugin.addon_handle self.sortmethods = sortmethods if sortmethods is not None else [ xbmcplugin.SORT_METHOD_TITLE] self.querychannelid = 0
Example #9
Source File: channelui.py From plugin.video.mediathekview with MIT License | 5 votes |
def __init__(self, plugin, sortmethods=None, nextdir='initial'): super(ChannelUI, self).__init__() self.plugin = plugin self.handle = plugin.addon_handle self.nextdir = nextdir self.sortmethods = sortmethods if sortmethods is not None else [ xbmcplugin.SORT_METHOD_TITLE] self.count = 0
Example #10
Source File: searches.py From plugin.video.mediathekview with MIT License | 5 votes |
def __init__(self, plugin, extendedsearch, sortmethods=None): self.plugin = plugin self.handle = plugin.addon_handle self.sortmethods = sortmethods if sortmethods is not None else [ xbmcplugin.SORT_METHOD_TITLE] self.extendedsearch = extendedsearch self.recents = [] self.datafile = os.path.join( self.plugin.settings.datapath, 'recent_ext_searches.json' if extendedsearch else 'recent_std_searches.json' )
Example #11
Source File: initialui.py From plugin.video.mediathekview with MIT License | 5 votes |
def __init__(self, plugin, sortmethods=None): self.plugin = plugin self.handle = plugin.addon_handle self.sortmethods = sortmethods if sortmethods is not None else [ xbmcplugin.SORT_METHOD_TITLE] self.channelid = 0 self.initial = '' self.count = 0
Example #12
Source File: default.py From ru with GNU General Public License v2.0 | 5 votes |
def get_manga(params): link='http://manga24.ru%s'%params['m_path'] http = GET(link) if http == None: return False #print http beautifulSoup = BeautifulSoup(http) content = beautifulSoup.find('ul', attrs={'class': 'mlist'}) try: cats=content.findAll('li') for scene in cats: title= str(scene).split('"')[1].split('/')[2] path= scene.find('a')['href'] listitem=xbmcgui.ListItem(title,addon_icon,addon_icon) listitem.setProperty('IsPlayable', 'false') uri = construct_request({ 'func': 'read_manga', 'm_path':path }) xbmcplugin.addDirectoryItem(hos, uri, listitem, True) except: try: content = beautifulSoup.find('div', attrs={'class': 'item2'}) path= content.find('a')['href'] listitem=xbmcgui.ListItem("Читать",addon_icon,addon_icon) listitem.setProperty('IsPlayable', 'false') uri = construct_request({ 'func': 'read_manga', 'm_path':path }) xbmcplugin.addDirectoryItem(hos, uri, listitem, True) except: pass xbmcplugin.addSortMethod(hos, xbmcplugin.SORT_METHOD_LABEL) xbmcplugin.addSortMethod(hos, xbmcplugin.SORT_METHOD_TITLE) #xbmcplugin.endOfDirectory(handle=hos, succeeded=True, updateListing=False, cacheToDisc=True) xbmcplugin.endOfDirectory(handle=hos, succeeded=True, updateListing=False, cacheToDisc=True)
Example #13
Source File: addon.py From plugin.video.stalker with GNU General Public License v2.0 | 4 votes |
def vodLevel(): try: data = load_channels.getVoD(portal['mac'], portal['url'], portal['serial'], addondir); except Exception as e: xbmcgui.Dialog().notification(addonname, str(e), xbmcgui.NOTIFICATION_ERROR ); return; data = data['vod']; for i in data: name = i["name"]; cmd = i["cmd"]; logo = i["logo"]; if logo != '': logo_url = portal['url'] + logo; else: logo_url = 'DefaultVideo.png'; url = build_url({ 'mode': 'play', 'cmd': cmd, 'tmp' : '0', 'title' : name.encode("utf-8"), 'genre_name' : 'VoD', 'logo_url' : logo_url, 'portal' : json.dumps(portal) }); li = xbmcgui.ListItem(name, iconImage=logo_url, thumbnailImage=logo_url) li.setInfo(type='Video', infoLabels={ "Title": name }) xbmcplugin.addDirectoryItem(handle=addon_handle, url=url, listitem=li) xbmcplugin.addSortMethod(addon_handle, xbmcplugin.SORT_METHOD_UNSORTED); xbmcplugin.addSortMethod(addon_handle, xbmcplugin.SORT_METHOD_TITLE); xbmcplugin.endOfDirectory(addon_handle);
Example #14
Source File: KodiHelper.py From plugin.video.netflix with MIT License | 4 votes |
def build_season_listing(self, seasons_sorted, build_url, widget_display=False): """Builds the season list screen for a show Parameters ---------- seasons_sorted : :obj:`list` of :obj:`dict` of :obj:`str` Sorted list of season entries build_url : :obj:`fn` Function to build the subsequent routes Returns ------- bool List could be build """ for season in seasons_sorted: li = xbmcgui.ListItem(label=season['text']) # add some art to the item li.setArt(self._generate_art_info(entry=season)) # add list item info infos = self._generate_listitem_info( entry=season, li=li, base_info={'mediatype': 'season'}) self._generate_context_menu_items(entry=season, li=li) params = {'action': 'episode_list', 'season_id': season['id']} if 'tvshowtitle' in infos: title = infos.get('tvshowtitle', '').encode('utf-8') params['tvshowtitle'] = base64.urlsafe_b64encode(title) url = build_url(params) xbmcplugin.addDirectoryItem( handle=self.plugin_handle, url=url, listitem=li, isFolder=True) xbmcplugin.addSortMethod( handle=self.plugin_handle, sortMethod=xbmcplugin.SORT_METHOD_NONE) xbmcplugin.addSortMethod( handle=self.plugin_handle, sortMethod=xbmcplugin.SORT_METHOD_VIDEO_YEAR) xbmcplugin.addSortMethod( handle=self.plugin_handle, sortMethod=xbmcplugin.SORT_METHOD_LABEL) xbmcplugin.addSortMethod( handle=self.plugin_handle, sortMethod=xbmcplugin.SORT_METHOD_LASTPLAYED) xbmcplugin.addSortMethod( handle=self.plugin_handle, sortMethod=xbmcplugin.SORT_METHOD_TITLE) xbmcplugin.setContent( handle=self.plugin_handle, content=CONTENT_SEASON) xbmcplugin.endOfDirectory(self.plugin_handle) if not widget_display: self.set_custom_view(VIEW_SEASON) return True