View Single Post
Old 08-16-2023, 06:33 AM   #4
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,474
Karma: 8025600
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by imnnrv View Post
EXCEPTION: The function book_count can be used only in the GUI
Ignore that message, and also the one that follows saying that no fields are in the template. Both of these are historical artifacts that I haven't bothered to try to fix.

EDIT2: I submitted changes to @kovid to remove the errors.
EDIT3: The changes are in calibre source.

If you don't want to ignore the messages then create a new "Column built from other columns" and put the template there. Use the new column's lookup key in the save to disk template. In this case you must set the tweak
Code:
allow_template_database_functions_in_composites
as described in this post.

EDIT: for performance reasons it would be best to hide the new column in the book list so it isn't frequently evaluated.

For your if tests, see General Program Mode in the template language manual..

Last edited by chaley; 08-16-2023 at 01:05 PM.
chaley is offline   Reply With Quote