clear all cached sizes
This commit is contained in:
parent
d0e2fe0340
commit
b899768130
4 changed files with 39 additions and 22 deletions
|
|
@ -82,6 +82,15 @@ class Icons(dict):
|
|||
c.close()
|
||||
conn.close()
|
||||
|
||||
def clear(self, prefix):
|
||||
sql = 'DELETE FROM icon WHERE id LIKE ?'
|
||||
conn = self.connect()
|
||||
c = conn.cursor()
|
||||
c.execute(sql, (prefix + '%', ))
|
||||
conn.commit()
|
||||
c.close()
|
||||
conn.close()
|
||||
|
||||
icons = Icons(icons_db_path)
|
||||
|
||||
@run_async
|
||||
|
|
@ -122,9 +131,7 @@ def get_icon(id, type_, size, callback):
|
|||
callback(data)
|
||||
|
||||
def clear_default_cover_cache():
|
||||
for resolution in (64, 128, 256, 512, 1024):
|
||||
key = '%s:%s:%s' % ('default', 'cover', resolution)
|
||||
del icons[key]
|
||||
icons.clear('default:cover:')
|
||||
|
||||
@run_async
|
||||
def get_icon_app(id, type_, size, callback):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue