Python源码示例:xbmcplugin.SORT_METHOD_GENRE
示例1
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)
示例2
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)
示例3
def set_view(view_id, content=None):
if content is not None:
xbmcplugin.setContent(HANDLE_ID, content)
xbmc.executebuiltin("Container.SetViewMode(%s)" % view_id)
xbmcplugin.addSortMethod( handle=HANDLE_ID, sortMethod=xbmcplugin.SORT_METHOD_UNSORTED )
xbmcplugin.addSortMethod( handle=HANDLE_ID, sortMethod=xbmcplugin.SORT_METHOD_LABEL )
xbmcplugin.addSortMethod( handle=HANDLE_ID, sortMethod=xbmcplugin.SORT_METHOD_VIDEO_RATING )
xbmcplugin.addSortMethod( handle=HANDLE_ID, sortMethod=xbmcplugin.SORT_METHOD_DATE )
xbmcplugin.addSortMethod( handle=HANDLE_ID, sortMethod=xbmcplugin.SORT_METHOD_PROGRAM_COUNT )
xbmcplugin.addSortMethod( handle=HANDLE_ID, sortMethod=xbmcplugin.SORT_METHOD_VIDEO_RUNTIME )
xbmcplugin.addSortMethod( handle=HANDLE_ID, sortMethod=xbmcplugin.SORT_METHOD_GENRE )