default.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:plugin.audio.euskarazko-irratiak 作者: aldatsa 项目源码 文件源码
def list_podcast_audios(audios):
    audio_list = []

    # iterate over the audios to build the list
    for audio in audios:
        # create a list item using the audio's title for the label
        li = xbmcgui.ListItem(audio['date'] + " - " + audio['title'])

        if 'image' in audio:
            # set the thumbnail image
            li.setArt({'thumb': audio['image']})

        # set the list item to playable
        li.setProperty('IsPlayable', 'true')

        # build the plugin url for Kodi
        url = build_url({'mode': 'stream', 'url': audio['url'].encode('utf8'), 'title': audio['date'] + " - " + urllib.quote(audio['title'].encode('utf8'))})

        # add the current list item to a list
        audio_list.append((url, li, False))

    # add list to Kodi per Martijn
    # http://forum.kodi.tv/showthread.php?tid=209948&pid=2094170#pid2094170
    xbmcplugin.addDirectoryItems(addon_handle, audio_list, len(audio_list))

    # set the content of the directory
    xbmcplugin.setContent(addon_handle, 'songs')
    xbmcplugin.endOfDirectory(addon_handle)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号