mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-22 13:06:13 +01:00
Dont modify database when no dirtied annotations are present
This commit is contained in:
parent
3a9cc685dd
commit
cda8dffc3a
2 changed files with 6 additions and 5 deletions
|
|
@ -1795,11 +1795,12 @@ def set_annotations_for_book(self, book_id, fmt, annots_list, user_type='local',
|
|||
save_annotations_for_book(self.conn.cursor(), book_id, fmt, annots_list, user_type, user)
|
||||
|
||||
def dirty_books_with_dirtied_annotations(self):
|
||||
self.execute('''
|
||||
INSERT or IGNORE INTO metadata_dirtied(book) SELECT book FROM annotations_dirtied;
|
||||
DELETE FROM annotations_dirtied;
|
||||
''')
|
||||
return self.conn.changes() > 0
|
||||
with self.conn:
|
||||
self.execute('INSERT or IGNORE INTO metadata_dirtied(book) SELECT book FROM annotations_dirtied;')
|
||||
changed = self.conn.changes() > 0
|
||||
if changed:
|
||||
self.execute('DELETE FROM annotations_dirtied')
|
||||
return changed
|
||||
|
||||
def conversion_options(self, book_id, fmt):
|
||||
for (data,) in self.conn.get('SELECT data FROM conversion_options WHERE book=? AND format=?', (book_id, fmt.upper())):
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Reference in a new issue