Example #1
0
def listWatchlist(asset_type, page=0):
    skygo.login()
    url = base_url + 'get?type=' + asset_type + '&page=' + str(
        page) + '&pageSize=8'
    r = skygo.session.get(url)
    data = json.loads(r.text[3:len(r.text) - 1])

    listitems = []
    if data.get('watchlist', None):
        for item in data['watchlist']:
            asset = skygo.getAssetDetails(item['assetId'])
            for asset_details in nav.getAssets([asset]):
                listitems.append(asset_details)

        if data['hasNext']:
            url = common.build_url({
                'action': 'watchlist',
                'list': asset_type,
                'page': page + 1
            })
            listitems.append({'type': 'path', 'label': 'Mehr...', 'url': url})

    nav.listAssets(listitems, isWatchlist=True)

    xbmcplugin.endOfDirectory(skygo.addon_handle, cacheToDisc=True)
Example #2
0
def listWatchlist(asset_type, page=0):
    skygo.login()
    url = base_url + 'get?type=' + asset_type + '&page=' + str(page) + '&pageSize=8'
    r = skygo.session.get(url)
    data = json.loads(r.text[3:len(r.text) - 1])
    if not 'watchlist' in data:
        return
    listitems = []
    for item in data['watchlist']:
        asset = skygo.getAssetDetails(item['assetId'])
        for asset_details in nav.getAssets([asset]):
            listitems.append(asset_details)

    if data['hasNext']:
        url = common.build_url({'action': 'watchlist', 'list': asset_type, 'page': page + 1})
        listitems.append({'type': 'path', 'label': 'Mehr...', 'url': url})

    nav.listAssets(listitems, isWatchlist=True)
def listWatchlist(asset_type, page=0):
    skygo.login()
    url = base_url + 'get?type=' + asset_type + '&page=' + str(page) + '&pageSize=8'
    r = skygo.session.get(url)
    data = json.loads(r.text[3:len(r.text)-1])
    if not 'watchlist' in data:
        return
    listitems = []    
    for item in data['watchlist']:
        asset = skygo.getAssetDetails(item['assetId'])        
        for asset_details in nav.getAssets([asset]):
            listitems.append(asset_details)
    
    if data['hasNext']:
        url = common.build_url({'action': 'watchlist', 'list': asset_type, 'page': page+1})    
        listitems.append({'type': 'path', 'label': 'Mehr...', 'url': url})

    nav.listAssets(listitems, isWatchlist=True)
     if 'page' in params:
         nav.getPage(params['page'])
     elif 'url' in params:
         path = params['url']
         listAssets(mas.Assets.parseHtmlAssets(path))
     elif 'id' in params:
         navid = params['id']
         use_filter = False
         start = 1
         if 'use_filter' in params:
             if params['use_filter'].lower() == 'true':
                 use_filter = True
         if 'start' in params:
             start = params['start']
         nav.listAssets(params['id'],
                        use_filter=use_filter,
                        start=start)
 elif params['action'] == 'play':
     if 'id' in params:
         assetid = params['id']
         nav.playAsset(assetid)
 elif params['action'] == 'export':
     if 'id' in params:
         xbmc.executebuiltin('ActivateWindow(busydialog)')
         mas.Assets.exportAsset(params['id'])
         xbmc.executebuiltin('Dialog.Close(busydialog)')
         dlg = xbmcgui.Dialog()
         if dlg.yesno('Bibliothek', 'Bibliothek jetzt aktualisieren?'):
             xbmc.executebuiltin('UpdateLibrary(video)')
 elif params['action'] == 'add':
     mas.Assets.addToNotepad(params['id'])
 if params['action'] == 'list':
     if 'page' in params:
         nav.getPage(params['page'])
     elif 'url' in params:
         path = params['url']
         listAssets(mas.Assets.parseHtmlAssets(path))
     elif 'id' in params:
         navid = params['id']
         use_filter = False
         start = 1
         if 'use_filter' in params:
             if params['use_filter'].lower() == 'true':
                 use_filter = True
         if 'start' in params:
             start = params['start']
         nav.listAssets(params['id'], use_filter=use_filter, start=start)
 elif params['action'] == 'play':
     if 'id' in params:
         assetid = params['id']
         nav.playAsset(assetid)
 elif params['action'] == 'export':
     if 'id' in params:
         xbmc.executebuiltin('ActivateWindow(busydialog)')
         mas.Assets.exportAsset(params['id'])
         xbmc.executebuiltin('Dialog.Close(busydialog)')
         dlg = xbmcgui.Dialog()
         if dlg.yesno('Bibliothek', 'Bibliothek jetzt aktualisieren?'):
             xbmc.executebuiltin('UpdateLibrary(video)')
 elif params['action'] == 'add':
     mas.Assets.addToNotepad(params['id'])
     xbmc.executebuiltin('Container.Refresh')