Ejemplo n.º 1
0
 def _build_params(self, uni_fav, infolabels=''):
     
     uni_fav_ps = '?' + common.dict_to_paramstr(uni_fav)
     
     if infolabels:
         uni_fav_ps = uni_fav_ps + '&' + common.dict_to_paramstr(infolabels)
         
     return uni_fav_ps
Ejemplo n.º 2
0
    def _build_params(self, uni_fav, infolabels=''):

        uni_fav_ps = '?' + common.dict_to_paramstr(uni_fav)

        if infolabels:
            uni_fav_ps = uni_fav_ps + '&' + common.dict_to_paramstr(infolabels)

        return uni_fav_ps
Ejemplo n.º 3
0
def QueueItem(addon_id, title, url, is_resolved=False, img="", fanart="", infolabels=""):
    script_path = os.path.join(common.addon.get_path(), "lib", "universal", "playbackengine.py")
    pbe_infolabels = ""
    if infolabels:
        pbe_infolabels = str(common.encode_dict(infolabels))

    item_url = url
    if is_resolved == False:
        item_url = item_url + "&queued=true"

    pbe_params = {
        "pbe_mode": "queueitem",
        "pbe_addon_id": addon_id,
        "pbe_title": title,
        "pbe_url": item_url,
        "pbe_img": img,
        "pbe_fanart": fanart,
        "pbe_infolabels": pbe_infolabels,
    }
    pbe_script = 'XBMC.RunScript(%s, %s, %s, "%s")' % (
        script_path,
        sys.argv[1],
        "?" + common.dict_to_paramstr(pbe_params),
        "script.module.universal.playbackengine",
    )

    return pbe_script
Ejemplo n.º 4
0
 def add_my_history_directory(self, title='Watch History', img='', fanart=''):
     if not self.sys_argv:
         common.addon.log_error('-' + HELPER + '- -' +'sys.argv not passed in WatchHistory __init__(); Watch History directory will not be created.')
         return
         
     try:
         tmp_addon_id = 'plugin.video.watchhistory'
         tmp_addon = Addon(tmp_addon_id)
         tmp_addon_name = tmp_addon.get_name()                
     except:
         common.addon.log_error('-' + HELPER + '- -' +'Watch History video plugin not installed; Watch History directory will not be created.')
         common.notify(self.addon_id, 'small', ' - Watch History video addon required', 'Please install Watch History video addon from The ONE\'s XBMC Addons Repository.', '10000')                            
         return
     
     listitem = xbmcgui.ListItem(title, iconImage=img, thumbnailImage=img)
     listitem.setProperty('fanart_image', fanart)
     
     params = '?' + common.dict_to_paramstr( {'mode':'browse', 'addon_id':self.addon_id, 'local':'true'} )
     xbmcplugin.addDirectoryItem(handle=int(self.sys_argv[1]),url='plugin://plugin.video.watchhistory/'+params,isFolder=True,listitem=listitem)
Ejemplo n.º 5
0
    def add_my_history_directory(self,
                                 title='Watch History',
                                 img='',
                                 fanart=''):
        if not self.sys_argv:
            common.addon.log_error(
                '-' + HELPER + '- -' +
                'sys.argv not passed in WatchHistory __init__(); Watch History directory will not be created.'
            )
            return

        try:
            tmp_addon_id = 'plugin.video.watchhistory'
            tmp_addon = Addon(tmp_addon_id)
            tmp_addon_name = tmp_addon.get_name()
        except:
            common.addon.log_error(
                '-' + HELPER + '- -' +
                'Watch History video plugin not installed; Watch History directory will not be created.'
            )
            common.notify(
                self.addon_id, 'small',
                ' - Watch History video addon required',
                'Please install Watch History video addon from The ONE\'s XBMC Addons Repository.',
                '10000')
            return

        listitem = xbmcgui.ListItem(title, iconImage=img, thumbnailImage=img)
        listitem.setProperty('fanart_image', fanart)

        params = '?' + common.dict_to_paramstr({
            'mode': 'browse',
            'addon_id': self.addon_id,
            'local': 'true'
        })
        xbmcplugin.addDirectoryItem(handle=int(self.sys_argv[1]),
                                    url='plugin://plugin.video.watchhistory/' +
                                    params,
                                    isFolder=True,
                                    listitem=listitem)
Ejemplo n.º 6
0
def QueueItem(addon_id, title, url, is_resolved=False,img='', fanart='', infolabels=''):
    script_path = os.path.join(common.addon.get_path(), 'lib', 'universal', 'playbackengine.py')
    pbe_infolabels = ''
    if infolabels:
        pbe_infolabels = str(common.encode_dict(infolabels))
    
    item_url = url
    if is_resolved == False:
        item_url = item_url + '&queued=true'
    
    pbe_params = {
        'pbe_mode' : 'queueitem',
        'pbe_addon_id': addon_id,
        'pbe_title' : title,
        'pbe_url' : item_url,
        'pbe_img' : img,
        'pbe_fanart' : fanart,
        'pbe_infolabels' : pbe_infolabels
    }
    pbe_script = 'XBMC.RunScript(%s, %s, %s, "%s")' % (script_path, sys.argv[1], '?' + common.dict_to_paramstr(pbe_params), 'script.module.universal.playbackengine')
    
    return pbe_script
Ejemplo n.º 7
0
def QueueItem(addon_id, title, url, is_resolved=False,img='', fanart='', infolabels=''):
    script_path = os.path.join(common.addon.get_path(), 'lib', 'universal', 'playbackengine.py')
    pbe_infolabels = ''
    if infolabels:
        pbe_infolabels = str(common.encode_dict(infolabels))
    
    item_url = url
    if is_resolved == False:
        item_url = item_url + '&queued=true'
    
    pbe_params = {
        'pbe_mode' : 'queueitem',
        'pbe_addon_id': addon_id,
        'pbe_title' : title,
        'pbe_url' : item_url,
        'pbe_img' : img,
        'pbe_fanart' : fanart,
        'pbe_infolabels' : pbe_infolabels
    }
    pbe_script = 'XBMC.RunScript(%s, %s, %s, "%s")' % (script_path, sys.argv[1], '?' + common.dict_to_paramstr(pbe_params), 'script.module.universal.playbackengine')
    
    return pbe_script