mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Refresh cache on metadata edits
This commit is contained in:
parent
3b95fa8575
commit
d85fd5b737
@ -124,6 +124,9 @@ class BooksModel(QAbstractTableModel):
|
||||
def refresh_ids(self, ids, current_row=-1):
|
||||
rows = self.db.refresh_ids(ids)
|
||||
for row in rows:
|
||||
if self.cover_cache:
|
||||
id = self.db.id(row)
|
||||
self.cover_cache.refresh(id)
|
||||
if row == current_row:
|
||||
self.emit(SIGNAL('new_bookdisplay_data(PyQt_PyObject)'),
|
||||
self.get_book_display_info(row))
|
||||
|
@ -132,6 +132,16 @@ class CoverCache(QThread):
|
||||
self.cache = {}
|
||||
self.cache_lock.unlock()
|
||||
|
||||
def refresh(self, ids):
|
||||
self.cache_lock.lockForWrite()
|
||||
for id in ids:
|
||||
self.cache.pop(id, None)
|
||||
self.cache_lock.unlock()
|
||||
self.load_queue_lock.lockForWrite()
|
||||
for id in ids:
|
||||
self.load_queue.append_left(id)
|
||||
self.load_queue_lock.unlock()
|
||||
|
||||
class Concatenate(object):
|
||||
'''String concatenation aggregator for sqlite'''
|
||||
def __init__(self, sep=','):
|
||||
|
Loading…
x
Reference in New Issue
Block a user