Quote:
Originally Posted by ownedbycats
Would it make sense to include an explicit extra_file_count()? I think its currently possible with existing list functions (forgot exactly).
|
I am not interested in adding a plethora of specific functions that are trivially implementable with existing functions.
Code:
program:
list_count(extra_file_names(':'), ':')
or this Python template:
Code:
python:
def evaluate(book, context):
from calibre.gui2.ui import get_gui
extra_files = get_gui().current_db.new_api.list_extra_files(book.id, use_cache=True)
return str(len(extra_files)) if extra_files else ''
Edit: The Python template will be faster, which might be important if this is used for something like column icons.