當前位置: 首頁>>代碼示例>>Python>>正文


Python xbmcplugin.SORT_METHOD_DURATION屬性代碼示例

本文整理匯總了Python中xbmcplugin.SORT_METHOD_DURATION屬性的典型用法代碼示例。如果您正苦於以下問題:Python xbmcplugin.SORT_METHOD_DURATION屬性的具體用法?Python xbmcplugin.SORT_METHOD_DURATION怎麽用?Python xbmcplugin.SORT_METHOD_DURATION使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在xbmcplugin的用法示例。


在下文中一共展示了xbmcplugin.SORT_METHOD_DURATION屬性的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: menu_live

# 需要導入模塊: import xbmcplugin [as 別名]
# 或者: from xbmcplugin import SORT_METHOD_DURATION [as 別名]
def menu_live(params):

    listing = []
    live_medias = api.get_live_videos()
    
    if live_medias and len(live_medias):
        for live_media in live_medias:
            li = media_to_kodi_item(live_media)
            listing.append(li)  # Item label

    sortable_by = (xbmcplugin.SORT_METHOD_DATE,
                   xbmcplugin.SORT_METHOD_DURATION)

    return common.plugin.create_listing(
        listing,
        succeeded = True, #if False Kodi won’t open a new listing and stays on the current level.
        #update_listing = False, #if True, Kodi won’t open a sub-listing but refresh the current one. 
        #cache_to_disk = True, #cache this view to disk.
        #sort_methods = sortable_by, #he list of integer constants representing virtual folder sort methods.
        #view_mode = None, #a numeric code for a skin view mode. View mode codes are different in different skins except for 50 (basic listing).
        #content = None #string - current plugin content, e.g. ‘movies’ or ‘episodes’.
    ) 
開發者ID:rickybiscus,項目名稱:plugin.video.auvio,代碼行數:24,代碼來源:main.py

示例2: menu_homepage

# 需要導入模塊: import xbmcplugin [as 別名]
# 或者: from xbmcplugin import SORT_METHOD_DURATION [as 別名]
def menu_homepage(params):
    listing = []
    sid = '3669' #home sidebar

    sidebar_listing = get_sidebar_listing(sid)
    listing += sidebar_listing
    
    sortable_by = (xbmcplugin.SORT_METHOD_DATE,
                   xbmcplugin.SORT_METHOD_DURATION)

    return common.plugin.create_listing(
        listing,
        succeeded = True, #if False Kodi won’t open a new listing and stays on the current level.
        #update_listing = False, #if True, Kodi won’t open a sub-listing but refresh the current one. 
        #cache_to_disk = True, #cache this view to disk.
        #sort_methods = sortable_by, #he list of integer constants representing virtual folder sort methods.
        #view_mode = None, #a numeric code for a skin view mode. View mode codes are different in different skins except for 50 (basic listing).
        #content = None #string - current plugin content, e.g. ‘movies’ or ‘episodes’.
    ) 
開發者ID:rickybiscus,項目名稱:plugin.video.auvio,代碼行數:21,代碼來源:main.py

示例3: __init__

# 需要導入模塊: import xbmcplugin [as 別名]
# 或者: from xbmcplugin import SORT_METHOD_DURATION [as 別名]
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 
開發者ID:mediathekview,項目名稱:plugin.video.mediathekview,代碼行數:26,代碼來源:filmui.py

示例4: setSortMethodsForCurrentXBMCList

# 需要導入模塊: import xbmcplugin [as 別名]
# 或者: from xbmcplugin import SORT_METHOD_DURATION [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

示例5: setSortMethodsForCurrentXBMCList

# 需要導入模塊: import xbmcplugin [as 別名]
# 或者: from xbmcplugin import SORT_METHOD_DURATION [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

示例6: __init__

# 需要導入模塊: import xbmcplugin [as 別名]
# 或者: from xbmcplugin import SORT_METHOD_DURATION [as 別名]
def __init__(self):
        self._addon = KodiUtils.get_addon()
        self._addonid = self._addon.getAddonInfo('id')
        self._addon_name = self._addon.getAddonInfo('name')
        self._addon_url = sys.argv[0]
        self._addon_version = self._addon.getAddonInfo('version')
        self._common_addon_id = 'script.module.clouddrive.common'
        self._common_addon = KodiUtils.get_addon(self._common_addon_id)
        self._common_addon_version = self._common_addon.getAddonInfo('version')
        self._dialog = xbmcgui.Dialog()
        self._profile_path = Utils.unicode(KodiUtils.translate_path(self._addon.getAddonInfo('profile')))
        self._progress_dialog = DialogProgress(self._addon_name)
        self._progress_dialog_bg = DialogProgressBG(self._addon_name)
        self._export_progress_dialog_bg = DialogProgressBG(self._addon_name)
        self._system_monitor = KodiUtils.get_system_monitor()
        self._account_manager = AccountManager(self._profile_path)
        self._pin_dialog = None
        self.iskrypton = KodiUtils.get_home_property('iskrypton') == 'true'
        
        if len(sys.argv) > 1:
            self._addon_handle = int(sys.argv[1])
            self._addon_params = urlparse.parse_qs(sys.argv[2][1:])
            for param in self._addon_params:
                self._addon_params[param] = self._addon_params.get(param)[0]
            self._content_type = Utils.get_safe_value(self._addon_params, 'content_type')
            if not self._content_type:
                wid = xbmcgui.getCurrentWindowId()
                if wid == 10005 or wid == 10500 or wid == 10501 or wid == 10502:
                    self._content_type = 'audio'
                elif wid == 10002:
                    self._content_type = 'image'
                else:
                    self._content_type = 'video'
            xbmcplugin.addSortMethod(handle=self._addon_handle, sortMethod=xbmcplugin.SORT_METHOD_LABEL)
            xbmcplugin.addSortMethod(handle=self._addon_handle, sortMethod=xbmcplugin.SORT_METHOD_UNSORTED ) 
            xbmcplugin.addSortMethod(handle=self._addon_handle, sortMethod=xbmcplugin.SORT_METHOD_SIZE )
            xbmcplugin.addSortMethod(handle=self._addon_handle, sortMethod=xbmcplugin.SORT_METHOD_DATE )
            xbmcplugin.addSortMethod(handle=self._addon_handle, sortMethod=xbmcplugin.SORT_METHOD_DURATION ) 
開發者ID:cguZZman,項目名稱:script.module.clouddrive.common,代碼行數:40,代碼來源:addon.py


注:本文中的xbmcplugin.SORT_METHOD_DURATION屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。