Don't put duplicates in dirtied_queue

This commit is contained in:
Kovid Goyal 2010-09-24 08:33:42 -06:00
parent 87d70304bd
commit 60e7729906

View File

@ -578,13 +578,17 @@ class LibraryDatabase2(LibraryDatabase, SchemaUpgrade, CustomColumns):
return True return True
def dirtied(self, book_ids, commit=True): def dirtied(self, book_ids, commit=True):
self.conn.executemany( for book in book_ids:
'INSERT OR REPLACE INTO metadata_dirtied (book) VALUES (?)', try:
[(x,) for x in book_ids]) self.conn.execute(
'INSERT INTO metadata_dirtied (book) VALUES (?)',
(book,))
self.dirtied_queue.put(book)
except IntegrityError:
# Already in table
continue
if commit: if commit:
self.conn.commit() self.conn.commit()
for x in book_ids:
self.dirtied_queue.put(x)
def get_metadata(self, idx, index_is_id=False, get_cover=False): def get_metadata(self, idx, index_is_id=False, get_cover=False):
''' '''