I will look at this and try to handle it more gracefully. But I suggest you set the following condition on the chain to disable it for books that do not have the appropriate format:
Code:
template:program:
if selection_count() == 1 then
str_in_list(approximate_formats(), ',', 'EPUB', 'true', 0)
fi
datatype: text
comparison: =
Condition value = true
icon = epub.png
tooltip = Single book with an epub format
Replace
EPUB with whatever format you want, but in capitalized letters. And maybe find a nice epub icon to use it as the condition icon.
Edit1: Modified template to add another test for selection count.
Edit2: Remove redundant if statement.