mirror of
https://github.com/kovidgoyal/calibre.git
synced 2026-06-04 13:05:31 -04:00
Bug 1904305: annotation_count() displaying value for deleted annotations
This commit is contained in:
@@ -1949,7 +1949,10 @@ class DB(object):
|
||||
return changed
|
||||
|
||||
def annotation_count_for_book(self, book_id):
|
||||
for (count,) in self.execute('SELECT count(id) FROM annotations WHERE book=?', (book_id,)):
|
||||
for (count,) in self.execute('''
|
||||
SELECT count(id) FROM annotations
|
||||
WHERE book=? AND json_extract(annot_data, "$.removed") IS NULL
|
||||
''', (book_id,)):
|
||||
return count
|
||||
return 0
|
||||
|
||||
|
||||
Reference in New Issue
Block a user