Exemplo n.º 1
0
def AddSFShortcut():
    if not chooser.GetFave('OTT3'):
        return False

    path = xbmc.getInfoLabel('Skin.String(OTT3.Path)')
    label = xbmc.getInfoLabel('Skin.String(OTT3.Label)')
    icon = xbmc.getInfoLabel('Skin.String(OTT3.Icon)')
    folder = xbmc.getInfoLabel('Skin.String(OTT3.IsFolder)') == 'true'

    if len(path) == 0 or path == 'noop':
        return False

    fave = [label, icon, path]
    favourite.copyFave(SFFILE, fave)

    return True
Exemplo n.º 2
0
def AddSFShortcut(file):
    if not chooser.GetFave('OTT'):
        return False

    path = xbmc.getInfoLabel('Skin.String(OTT.Path)')
    label = xbmc.getInfoLabel('Skin.String(OTT.Label)')
    icon = xbmc.getInfoLabel('Skin.String(OTT.Icon)')
    folder = xbmc.getInfoLabel('Skin.String(OTT.IsFolder)') == 'true'

    if len(path) == 0 or path == 'noop':
        return False

    fave = [removeNumeric(label), icon, path]
    favourite.copyFave(file, fave)

    return True
Exemplo n.º 3
0
def quickLaunch():
    import chooser
    if not chooser.GetFave('SF_QL'):
        return False

    path = xbmc.getInfoLabel('Skin.String(SF_QL.Path)')

    if len(path) == 0 or path == 'noop':
        return

    if path.lower().startswith('activatewindow') and ',' in path: #i.e. NOT like ActivateWindow(filemanager)
        xbmc.executebuiltin(path)
        return

    import player
    player.playCommand(path)
Exemplo n.º 4
0
def run(path, includePlay):
    import xbmcgui
    if xbmcgui.Window(10000).getProperty('Super_Favourites_Chooser') == 'true':
        return

    import xbmc
    import chooser

    if not chooser.GetFave('SF_QL', path=path, includePlay=includePlay):
        return False

    path = xbmc.getInfoLabel('Skin.String(SF_QL.Path)')

    if len(path) == 0 or path == 'noop':
        return

    toTest = path.replace(',return', '').lower()

    if toTest.startswith(
            'activatewindow'
    ) and ',' in toTest:  #i.e. NOT like ActivateWindow(filemanager)
        if not toTest.startswith('activatewindow(10003'):  #Filemanager
            xbmc.executebuiltin(path)
            return

    #remove any spurious SF stuff, e.g.
    #ActivateWindow("weather?content_type=Chooser&sf_options=desc%3DShow%2520Weather%26_options_sf",return) needs to be
    #ActivateWindow(weather)
    path = path.replace('content_type=Chooser&', '')
    path = path.split('?sf_options')[0]
    path = path.replace('"', '')
    path = path.replace('"', '')
    if not path.endswith(')'):
        path += ')'

    contentMode = True
    if path.lower().startswith('executebuiltin'):
        contentMode = False

    import player
    player.playCommand(path, contentMode=contentMode)