Exemplo n.º 1
0
def add_folder_file(item):
    title = item['title']
    cover = item['cover']
    href = item['href']
    referer = item['referer']
    item_type = item['type']

    li = xbmcgui.ListItem(
        strutils.html_entities_decode(title),
        iconImage=fs_ua.thumbnail(cover),
        thumbnailImage=fs_ua.poster(cover),
        path=href
    )
    li.setProperty('IsPlayable', 'true')

    li.setInfo(type=item_type, infoLabels={'title': title})
    playCount = kodi.get_play_count(strutils.html_entities_decode(title))
    if playCount:
        li.setInfo(type=item_type, infoLabels={'title': title, 'playcount': 1})
        li.addContextMenuItems([
            (
            __language__(40001), "XBMC.RunPlugin(%s)" % strutils.construct_request({
                'mode': 'download',
                'file_url': str(href.encode('utf-8')),
                'file_name': strutils.html_entities_decode(title)
            })
            )
        ])

    if item_type == 'music' or (__settings__.getSetting('Autoplay next') == 'true'):
        uri = strutils.construct_request({
            'file': str(href.encode('utf-8')),
            'referer': referer,
            'mode': 'play',
            'playLink': item['playLink']
        })
    else:
        uri = client.get_full_url(href)

    xbmcplugin.addDirectoryItem(h, uri, li, False)
Exemplo n.º 2
0
def add_folder_file(item):
    title = item['title']
    cover = item['cover']
    href = item['href']
    referer = item['referer']
    item_type = item['type']

    li = xbmcgui.ListItem(strutils.html_entities_decode(title),
                          iconImage=fs_ua.thumbnail(cover),
                          thumbnailImage=fs_ua.poster(cover),
                          path=href)
    li.setProperty('IsPlayable', 'true')

    li.setInfo(type=item_type, infoLabels={'title': title})
    playCount = kodi.get_play_count(strutils.html_entities_decode(title))
    if playCount:
        li.setInfo(type=item_type, infoLabels={'title': title, 'playcount': 1})
        li.addContextMenuItems([
            (__language__(40001),
             "XBMC.RunPlugin(%s)" % strutils.construct_request(
                 {
                     'mode': 'download',
                     'file_url': str(href.encode('utf-8')),
                     'file_name': strutils.html_entities_decode(title)
                 }))
        ])

    if item_type == 'music' or (__settings__.getSetting('Autoplay next')
                                == 'true'):
        uri = strutils.construct_request({
            'file': str(href.encode('utf-8')),
            'referer': referer,
            'mode': 'play',
            'playLink': item['playLink']
        })
    else:
        uri = client.get_full_url(href)

    xbmcplugin.addDirectoryItem(h, uri, li, False)