mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-06-23 15:30:45 -04:00
Dont modify database when no dirtied annotations are present
This commit is contained in:
parent
3a9cc685dd
commit
cda8dffc3a
@ -1795,11 +1795,12 @@ class DB(object):
|
|||||||
save_annotations_for_book(self.conn.cursor(), book_id, fmt, annots_list, user_type, user)
|
save_annotations_for_book(self.conn.cursor(), book_id, fmt, annots_list, user_type, user)
|
||||||
|
|
||||||
def dirty_books_with_dirtied_annotations(self):
|
def dirty_books_with_dirtied_annotations(self):
|
||||||
self.execute('''
|
with self.conn:
|
||||||
INSERT or IGNORE INTO metadata_dirtied(book) SELECT book FROM annotations_dirtied;
|
self.execute('INSERT or IGNORE INTO metadata_dirtied(book) SELECT book FROM annotations_dirtied;')
|
||||||
DELETE FROM annotations_dirtied;
|
changed = self.conn.changes() > 0
|
||||||
''')
|
if changed:
|
||||||
return self.conn.changes() > 0
|
self.execute('DELETE FROM annotations_dirtied')
|
||||||
|
return changed
|
||||||
|
|
||||||
def conversion_options(self, book_id, fmt):
|
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())):
|
for (data,) in self.conn.get('SELECT data FROM conversion_options WHERE book=? AND format=?', (book_id, fmt.upper())):
|
||||||
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user