mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -04:00
Merge branch 'master' of https://github.com/cbhaley/calibre
Template language: Fix annotations_count() not ignoring removed annotations. Fixes #1904305 [annotation_count() displaying value for deleted annotations](https://bugs.launchpad.net/calibre/+bug/1904305)
This commit is contained in:
commit
1e4e3d809a
@ -1949,7 +1949,10 @@ class DB(object):
|
|||||||
return changed
|
return changed
|
||||||
|
|
||||||
def annotation_count_for_book(self, book_id):
|
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 count
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user