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
评论列表
文章目录