View Single Post
Old 10-31-2020, 10:44 AM   #894
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,499
Karma: 8065348
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by chaley View Post
It is possible but it would be very slow requiring fetching all annotations from the database. I am not going to add it until/if/when that changes.
Quote:
Originally Posted by ownedbycats View Post
Understandable. I might make an enhancement request for some option to mark all the books with annotations.
After discussions with Kovid I will add a new database method to calibre that returns the number of annotations of all kinds and on all formats attached to the book. This method runs without needing to read the database tables so it is as fast as we can make it, one hopes fast enough.

I also added a template function annotation_count() that returns the count if it is > 0 else the empty string. This will work with template functions like "isempty()", "test()", "first_non_empty", etc. It will also work with numeric relationals such as "if annotation_count() ># 0 then 'foo' else 'bar' fi"
chaley is offline   Reply With Quote