utils.py 文件源码

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

项目:script.module.metadatautils 作者: marcelveldt 项目源码 文件源码
def refresh_image(imagepath):
    '''tell kodi texture cache to refresh a particular image'''
    import sqlite3
    dbpath = xbmc.translatePath("special://database/Textures13.db").decode('utf-8')
    connection = sqlite3.connect(dbpath, timeout=30, isolation_level=None)
    try:
        cache_image = connection.execute('SELECT cachedurl FROM texture WHERE url = ?', (imagepath,)).fetchone()
        if cache_image and isinstance(cache_image, (unicode, str)):
            if xbmcvfs.exists(cache_image):
                xbmcvfs.delete("special://profile/Thumbnails/%s" % cache_image)
            connection.execute('DELETE FROM texture WHERE url = ?', (imagepath,))
        connection.close()
    except Exception as exc:
        log_exception(__name__, exc)
    finally:
        del connection

# pylint: disable-msg=too-many-local-variables
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号