utils.py 文件源码

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

项目:context.elementum 作者: elgatito 项目源码 文件源码
def getMediaType():
    version = xbmcVersion()

    if xbmc.getInfoLabel('ListItem.DBTYPE'):
        # Seasons and calls from library will work
        return xbmc.getInfoLabel('ListItem.DBTYPE')
    elif version >= 18:
        # Will work on Kodi 17 and further
        return getVideoTag().getMediaType()
    else:
        # No other way, we query Kodi for information
        dbid = getDbId()

        response = getJSONResponse('{"jsonrpc": "2.0", "method": "VideoLibrary.GetMovieDetails", "params": { "movieid": %s }, "id": "0"}' % dbid)
        if 'error' not in response:
            return 'movie'

        response = getJSONResponse('{"jsonrpc": "2.0", "method": "VideoLibrary.GetEpisodeDetails", "params": { "episodeid": %s }, "id": "0"}' % dbid)
        if 'error' not in response:
            return 'episode'

        return None
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号