コード例 #1
0
def related_lists(tmdb_id=None,
                  tmdb_type=None,
                  season=None,
                  episode=None,
                  container_update=True,
                  include_play=False,
                  **kwargs):
    if not tmdb_id or not tmdb_type:
        return
    items = get_basedir_details(tmdb_type=tmdb_type,
                                tmdb_id=tmdb_id,
                                season=season,
                                episode=episode,
                                include_play=include_play)
    if not items or len(items) <= 1:
        return
    choice = xbmcgui.Dialog().contextmenu([i.get('label') for i in items])
    if choice == -1:
        return
    item = items[choice]
    params = item.get('params')
    if not params:
        return
    item['params']['tmdb_id'] = tmdb_id
    item['params']['tmdb_type'] = tmdb_type
    if not container_update:
        return item
    path = format_folderpath(
        path=encode_url(path=item.get('path'), **item.get('params')),
        info=item['params']['info'],
        play=
        'RunPlugin',  # Use RunPlugin to avoid window manager info dialog crash with Browse method
        content='pictures'
        if item['params']['info'] in ['posters', 'fanart'] else 'videos')
    xbmc.executebuiltin(try_encode(path))
コード例 #2
0
def sort_list(**kwargs):
    sort_methods = get_sort_methods()
    x = xbmcgui.Dialog().contextmenu([i['name'] for i in sort_methods])
    if x == -1:
        return
    for k, v in viewitems(sort_methods[x]['params']):
        kwargs[k] = v
    xbmc.executebuiltin(try_encode(format_folderpath(encode_url(**kwargs))))
コード例 #3
0
 def configure_action(self, listitem, handle=None):
     path = listitem.getPath()
     if listitem.getProperty('is_folder') == 'true':
         return format_folderpath(path)
     if not handle or listitem.getProperty('is_resolvable') == 'false':
         return path
     if listitem.getProperty('is_resolvable') == 'select' and not xbmcgui.Dialog().yesno(
             '{} - {}'.format(listitem.getProperty('player_name'), ADDON.getLocalizedString(32353)),
             ADDON.getLocalizedString(32354),
             yeslabel=u"{} (setResolvedURL)".format(xbmc.getLocalizedString(107)),
             nolabel=u"{} (PlayMedia)".format(xbmc.getLocalizedString(106))):
         return path
コード例 #4
0
 def configure_action(self, listitem, handle=None):
     path = try_decode(listitem.getPath())
     if listitem.getProperty('is_folder') == 'true':
         return format_folderpath(path)
     action = 'run_plugin' if path.startswith('plugin://') else 'play_media'
     action = u'RunScript(plugin.video.themoviedb.helper,{}={})'.format(
         action, path)
     if path.endswith('.strm'):
         return action
     if not handle or listitem.getProperty('is_resolvable') == 'false':
         return action
     if listitem.getProperty(
             'is_resolvable') == 'select' and xbmcgui.Dialog().yesno(
                 '{} - {}'.format(listitem.getProperty('player_name'),
                                  ADDON.getLocalizedString(32324)),
                 ADDON.getLocalizedString(32325),
                 yeslabel='PlayMedia',
                 nolabel='setResolvedUrl'):
         return action