当前位置: 首页>>代码示例>>Python>>正文


Python xbmcplugin.SORT_METHOD_UNSORTED属性代码示例

本文整理汇总了Python中xbmcplugin.SORT_METHOD_UNSORTED属性的典型用法代码示例。如果您正苦于以下问题:Python xbmcplugin.SORT_METHOD_UNSORTED属性的具体用法?Python xbmcplugin.SORT_METHOD_UNSORTED怎么用?Python xbmcplugin.SORT_METHOD_UNSORTED使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在xbmcplugin的用法示例。


在下文中一共展示了xbmcplugin.SORT_METHOD_UNSORTED属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: my_streams_menu

# 需要导入模块: import xbmcplugin [as 别名]
# 或者: from xbmcplugin import SORT_METHOD_UNSORTED [as 别名]
def my_streams_menu():
	if not os.path.exists(mystrm_folder): xbmcvfs.mkdir(mystrm_folder)
	files = os.listdir(mystrm_folder)
	if files:
		for fic in files:
			content = readfile(os.path.join(mystrm_folder,fic)).split('|')
			if content:
				if 'acestream://' in content[1] or '.acelive' in content[1] or '.torrent' in content[1]:
					addDir(content[0],content[1],1,content[2],1,False) 
				elif 'sop://' in content[1]:
					addDir(content[0],content[1],2,content[2],1,False) 
				else:
					pass
		xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_UNSORTED)
		xbmcplugin.addSortMethod(int(sys.argv[1]), xbmcplugin.SORT_METHOD_LABEL)
	addDir('[B][COLOR maroon]'+translate(30009)+'[/COLOR][/B]',MainURL,11,os.path.join(addonpath,art,'plus-menu.png'),1,False) 
开发者ID:enen92,项目名称:program.plexus,代码行数:18,代码来源:mystreams.py

示例2: browse_topartists

# 需要导入模块: import xbmcplugin [as 别名]
# 或者: from xbmcplugin import SORT_METHOD_UNSORTED [as 别名]
def browse_topartists(self):
        xbmcplugin.setContent(self.addon_handle, "artists")
        result = self.sp.current_user_top_artists(limit=20, offset=0)
        cachestr = "spotify.topartists.%s" % self.userid
        checksum = self.cache_checksum(result["total"])
        items = self.cache.get(cachestr, checksum=checksum)
        if not items:
            count = len(result["items"])
            while result["total"] > count:
                result["items"] += self.sp.current_user_top_artists(limit=20, offset=count)["items"]
                count += 50
            items = self.prepare_artist_listitems(result["items"])
            self.cache.set(cachestr, items, checksum=checksum)
        self.add_artist_listitems(items)
        xbmcplugin.addSortMethod(self.addon_handle, xbmcplugin.SORT_METHOD_UNSORTED)
        xbmcplugin.endOfDirectory(handle=self.addon_handle)
        if self.defaultview_artists:
            xbmc.executebuiltin('Container.SetViewMode(%s)' % self.defaultview_artists) 
开发者ID:kodi-community-addons,项目名称:plugin.audio.spotify,代码行数:20,代码来源:plugin_content.py

示例3: browse_toptracks

# 需要导入模块: import xbmcplugin [as 别名]
# 或者: from xbmcplugin import SORT_METHOD_UNSORTED [as 别名]
def browse_toptracks(self):
        xbmcplugin.setContent(self.addon_handle, "songs")
        results = self.sp.current_user_top_tracks(limit=20, offset=0)
        cachestr = "spotify.toptracks.%s" % self.userid
        checksum = self.cache_checksum(results["total"])
        items = self.cache.get(cachestr, checksum=checksum)
        if not items:
            items = results["items"]
            while results["next"]:
                results = self.sp.next(results)
                items.extend(results["items"])
            items = self.prepare_track_listitems(tracks=items)
            self.cache.set(cachestr, items, checksum=checksum)
        self.add_track_listitems(items, True)
        xbmcplugin.addSortMethod(self.addon_handle, xbmcplugin.SORT_METHOD_UNSORTED)
        xbmcplugin.endOfDirectory(handle=self.addon_handle)
        if self.defaultview_songs:
            xbmc.executebuiltin('Container.SetViewMode(%s)' % self.defaultview_songs) 
开发者ID:kodi-community-addons,项目名称:plugin.audio.spotify,代码行数:20,代码来源:plugin_content.py

示例4: browse_album

# 需要导入模块: import xbmcplugin [as 别名]
# 或者: from xbmcplugin import SORT_METHOD_UNSORTED [as 别名]
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) 
开发者ID:kodi-community-addons,项目名称:plugin.audio.spotify,代码行数:20,代码来源:plugin_content.py

示例5: search_artists

# 需要导入模块: import xbmcplugin [as 别名]
# 或者: from xbmcplugin import SORT_METHOD_UNSORTED [as 别名]
def search_artists(self):
        xbmcplugin.setContent(self.addon_handle, "artists")
        xbmcplugin.setProperty(self.addon_handle, 'FolderName', xbmc.getLocalizedString(133))
        result = self.sp.search(
            q="artist:%s" %
            self.artistid,
            type='artist',
            limit=self.limit,
            offset=self.offset,
            market=self.usercountry)
        artists = self.prepare_artist_listitems(result['artists']['items'])
        self.add_artist_listitems(artists)
        self.add_next_button(result['artists']['total'])
        xbmcplugin.addSortMethod(self.addon_handle, xbmcplugin.SORT_METHOD_UNSORTED)
        xbmcplugin.endOfDirectory(handle=self.addon_handle)
        if self.defaultview_artists:
            xbmc.executebuiltin('Container.SetViewMode(%s)' % self.defaultview_artists) 
开发者ID:kodi-community-addons,项目名称:plugin.audio.spotify,代码行数:19,代码来源:plugin_content.py

示例6: search_albums

# 需要导入模块: import xbmcplugin [as 别名]
# 或者: from xbmcplugin import SORT_METHOD_UNSORTED [as 别名]
def search_albums(self):
        xbmcplugin.setContent(self.addon_handle, "albums")
        xbmcplugin.setProperty(self.addon_handle, 'FolderName', xbmc.getLocalizedString(132))
        result = self.sp.search(
            q="album:%s" %
            self.albumid,
            type='album',
            limit=self.limit,
            offset=self.offset,
            market=self.usercountry)
        albumids = []
        for album in result['albums']['items']:
            albumids.append(album["id"])
        albums = self.prepare_album_listitems(albumids)
        self.add_album_listitems(albums, True)
        self.add_next_button(result['albums']['total'])
        xbmcplugin.addSortMethod(self.addon_handle, xbmcplugin.SORT_METHOD_UNSORTED)
        xbmcplugin.endOfDirectory(handle=self.addon_handle)
        if self.defaultview_albums:
            xbmc.executebuiltin('Container.SetViewMode(%s)' % self.defaultview_albums) 
开发者ID:kodi-community-addons,项目名称:plugin.audio.spotify,代码行数:22,代码来源:plugin_content.py

示例7: finish_container

# 需要导入模块: import xbmcplugin [as 别名]
# 或者: from xbmcplugin import SORT_METHOD_UNSORTED [as 别名]
def finish_container(self):
        if self.params.get('random'):
            return
        for k, v in self.params.items():
            if not k or not v:
                continue
            try:
                xbmcplugin.setProperty(self.handle, u'Param.{}'.format(k), u'{}'.format(v))  # Set params to container properties
            except Exception as exc:
                utils.kodi_log(u'Error: {}\nUnable to set Param.{} to {}'.format(exc, k, v), 1)

        if self.item_dbtype in ['movie', 'tvshow', 'episode']:
            xbmcplugin.addSortMethod(self.handle, xbmcplugin.SORT_METHOD_UNSORTED)
            xbmcplugin.addSortMethod(self.handle, xbmcplugin.SORT_METHOD_EPISODE) if self.item_dbtype == 'episode' else None
            xbmcplugin.addSortMethod(self.handle, xbmcplugin.SORT_METHOD_TITLE_IGNORE_THE)
            xbmcplugin.addSortMethod(self.handle, xbmcplugin.SORT_METHOD_LASTPLAYED)
            xbmcplugin.addSortMethod(self.handle, xbmcplugin.SORT_METHOD_PLAYCOUNT)

        xbmcplugin.endOfDirectory(self.handle, updateListing=self.updatelisting) 
开发者ID:jurialmunkey,项目名称:plugin.video.themoviedb.helper,代码行数:21,代码来源:container.py

示例8: setSortMethodsForCurrentXBMCList

# 需要导入模块: import xbmcplugin [as 别名]
# 或者: from xbmcplugin import SORT_METHOD_UNSORTED [as 别名]
def setSortMethodsForCurrentXBMCList(handle, sortKeys):
    
    def addSortMethod(method):
        xbmcplugin.addSortMethod(handle = handle, sortMethod = method)
    
    if not sortKeys or sortKeys==[]: 
        addSortMethod(xbmcplugin.SORT_METHOD_UNSORTED)
    else:     
        if 'name' in sortKeys:
            addSortMethod(xbmcplugin.SORT_METHOD_LABEL)
        if 'size' in sortKeys:
            addSortMethod(xbmcplugin.SORT_METHOD_SIZE)
        if 'duration' in sortKeys:
            addSortMethod(xbmcplugin.SORT_METHOD_DURATION)
        if 'genre' in sortKeys:
            addSortMethod(xbmcplugin.SORT_METHOD_GENRE)
        if 'rating' in sortKeys:
            addSortMethod(xbmcplugin.SORT_METHOD_VIDEO_RATING)
        if 'date' in sortKeys:
            addSortMethod(xbmcplugin.SORT_METHOD_DATE)
        if 'file' in sortKeys:
            addSortMethod(xbmcplugin.SORT_METHOD_FILE) 
开发者ID:mrknow,项目名称:filmkodi,代码行数:24,代码来源:xbmcUtils.py

示例9: setSortMethodsForCurrentXBMCList

# 需要导入模块: import xbmcplugin [as 别名]
# 或者: from xbmcplugin import SORT_METHOD_UNSORTED [as 别名]
def setSortMethodsForCurrentXBMCList(handle, sortKeys):

    def addSortMethod(method):
        xbmcplugin.addSortMethod(handle = handle, sortMethod = method)

    if not sortKeys or sortKeys==[]:
        addSortMethod(xbmcplugin.SORT_METHOD_UNSORTED)
    else:
        if 'name' in sortKeys:
            addSortMethod(xbmcplugin.SORT_METHOD_LABEL)
        if 'size' in sortKeys:
            addSortMethod(xbmcplugin.SORT_METHOD_SIZE)
        if 'duration' in sortKeys:
            addSortMethod(xbmcplugin.SORT_METHOD_DURATION)
        if 'genre' in sortKeys:
            addSortMethod(xbmcplugin.SORT_METHOD_GENRE)
        if 'rating' in sortKeys:
            addSortMethod(xbmcplugin.SORT_METHOD_VIDEO_RATING)
        if 'date' in sortKeys:
            addSortMethod(xbmcplugin.SORT_METHOD_DATE)
        if 'file' in sortKeys:
            addSortMethod(xbmcplugin.SORT_METHOD_FILE) 
开发者ID:mrknow,项目名称:filmkodi,代码行数:24,代码来源:xbmcUtils.py

示例10: kodi_draw_list

# 需要导入模块: import xbmcplugin [as 别名]
# 或者: from xbmcplugin import SORT_METHOD_UNSORTED [as 别名]
def kodi_draw_list(parts, rows):
    for row in rows:
        xbmcplugin.addDirectoryItem(*row.item(parts))

    xbmcplugin.addSortMethod(h, xbmcplugin.SORT_METHOD_UNSORTED)
    xbmcplugin.addSortMethod(h, xbmcplugin.SORT_METHOD_LABEL)
    xbmcplugin.addSortMethod(h, xbmcplugin.SORT_METHOD_VIDEO_RATING)
    xbmcplugin.addSortMethod(h, xbmcplugin.SORT_METHOD_VIDEO_YEAR)
    xbmcplugin.addSortMethod(h, xbmcplugin.SORT_METHOD_DATE)
    xbmcplugin.setContent(h, 'files')
    xbmcplugin.endOfDirectory(h) 
开发者ID:Soap4me,项目名称:Kodi,代码行数:13,代码来源:addon.py

示例11: browse_main

# 需要导入模块: import xbmcplugin [as 别名]
# 或者: from xbmcplugin import SORT_METHOD_UNSORTED [as 别名]
def browse_main(self):
        # main listing
        xbmcplugin.setContent(self.addon_handle, "files")
        items = []
        items.append(
            (self.addon.getLocalizedString(11013),
             "plugin://plugin.audio.spotify/?action=browse_main_library",
             "DefaultMusicCompilations.png", True))
        items.append(
            (self.addon.getLocalizedString(11014),
             "plugin://plugin.audio.spotify/?action=browse_main_explore",
             "DefaultMusicGenres.png", True))
        items.append(
            (xbmc.getLocalizedString(137),
             "plugin://plugin.audio.spotify/?action=search",
             "DefaultMusicSearch.png", True))
        items.append(
            ("%s: %s" % (self.addon.getLocalizedString(11039), self.playername),
             "plugin://plugin.audio.spotify/?action=browse_playback_devices",
             "DefaultMusicPlugins.png", True))
        cur_user_label = self.sp.me()["display_name"]
        if not cur_user_label:
            cur_user_label = self.sp.me()["id"]
        label = "%s: %s" % (self.addon.getLocalizedString(11047), cur_user_label)
        items.append(
            (label,
             "plugin://plugin.audio.spotify/?action=switch_user",
             "DefaultActor.png", False))
        for item in items:
            li = xbmcgui.ListItem(
                item[0],
                path=item[1],
                iconImage=item[2]
            )
            li.setProperty('IsPlayable', 'false')
            li.setArt({"fanart": "special://home/addons/plugin.audio.spotify/fanart.jpg"})
            li.addContextMenuItems([], True)
            xbmcplugin.addDirectoryItem(handle=self.addon_handle, url=item[1], listitem=li, isFolder=item[3])
        xbmcplugin.addSortMethod(self.addon_handle, xbmcplugin.SORT_METHOD_UNSORTED)
        xbmcplugin.endOfDirectory(handle=self.addon_handle)
        self.refresh_connected_device() 
开发者ID:kodi-community-addons,项目名称:plugin.audio.spotify,代码行数:43,代码来源:plugin_content.py

示例12: artist_toptracks

# 需要导入模块: import xbmcplugin [as 别名]
# 或者: from xbmcplugin import SORT_METHOD_UNSORTED [as 别名]
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) 
开发者ID:kodi-community-addons,项目名称:plugin.audio.spotify,代码行数:16,代码来源:plugin_content.py

示例13: related_artists

# 需要导入模块: import xbmcplugin [as 别名]
# 或者: from xbmcplugin import SORT_METHOD_UNSORTED [as 别名]
def related_artists(self):
        xbmcplugin.setContent(self.addon_handle, "artists")
        xbmcplugin.setProperty(self.addon_handle, 'FolderName', self.addon.getLocalizedString(11012))
        cachestr = "spotify.relatedartists.%s" % self.artistid
        checksum = self.cache_checksum()
        artists = self.cache.get(cachestr, checksum=checksum)
        if not artists:
            artists = self.sp.artist_related_artists(self.artistid)
            artists = self.prepare_artist_listitems(artists['artists'])
            self.cache.set(cachestr, artists, checksum=checksum)
        self.add_artist_listitems(artists)
        xbmcplugin.addSortMethod(self.addon_handle, xbmcplugin.SORT_METHOD_UNSORTED)
        xbmcplugin.endOfDirectory(handle=self.addon_handle)
        if self.defaultview_artists:
            xbmc.executebuiltin('Container.SetViewMode(%s)' % self.defaultview_artists) 
开发者ID:kodi-community-addons,项目名称:plugin.audio.spotify,代码行数:17,代码来源:plugin_content.py

示例14: browse_playlist

# 需要导入模块: import xbmcplugin [as 别名]
# 或者: from xbmcplugin import SORT_METHOD_UNSORTED [as 别名]
def browse_playlist(self):
        xbmcplugin.setContent(self.addon_handle, "songs")
        playlistdetails = self.get_playlist_details(self.ownerid, self.playlistid)
        xbmcplugin.setProperty(self.addon_handle, 'FolderName', playlistdetails["name"])
        self.add_track_listitems(playlistdetails["tracks"]["items"], True)
        xbmcplugin.addSortMethod(self.addon_handle, xbmcplugin.SORT_METHOD_UNSORTED)
        xbmcplugin.endOfDirectory(handle=self.addon_handle)
        if self.defaultview_songs:
            xbmc.executebuiltin('Container.SetViewMode(%s)' % self.defaultview_songs) 
开发者ID:kodi-community-addons,项目名称:plugin.audio.spotify,代码行数:11,代码来源:plugin_content.py

示例15: browse_category

# 需要导入模块: import xbmcplugin [as 别名]
# 或者: from xbmcplugin import SORT_METHOD_UNSORTED [as 别名]
def browse_category(self):
        xbmcplugin.setContent(self.addon_handle, "files")
        playlists = self.get_category(self.filter)
        self.add_playlist_listitems(playlists['playlists']['items'])
        xbmcplugin.setProperty(self.addon_handle, 'FolderName', playlists['category'])
        xbmcplugin.addSortMethod(self.addon_handle, xbmcplugin.SORT_METHOD_UNSORTED)
        xbmcplugin.endOfDirectory(handle=self.addon_handle)
        if self.defaultview_category:
            xbmc.executebuiltin('Container.SetViewMode(%s)' % self.defaultview_category) 
开发者ID:kodi-community-addons,项目名称:plugin.audio.spotify,代码行数:11,代码来源:plugin_content.py


注:本文中的xbmcplugin.SORT_METHOD_UNSORTED属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。