View Single Post
Old 03-06-2023, 05:07 PM   #2
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,447
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by BetterRed View Post
AFAIK there is no easy way to know if specific conversion settings have been applied to a book. The Conversion dialogue has a Restore Defaults button, but it's enabled irrespective of whether book specific conversion settings actually exist.

So I'm requesting a template function similar to has_cover that can be used to define a virtual column, set a column colour/icon etc.

BR
Here is a python template that answers your question, at least for my tests. If you make a stored template with this code you can call it in a "normal" template like a function, as in 'has_opts = stored_template()'.
EDIT:
Code:
python:
def evaluate(book, context):
	ans = context.db.new_api.has_conversion_options((book.id,))
	return 'Yes' if ans else ''
EDIT: It returns "Yes" if the book has settings, '' otherwise.

The underlying function has a parameter for the format that as far as I can tell isn't used.

Last edited by chaley; 03-06-2023 at 05:12 PM. Reason: Made the function more "template like" by returning the empty string if False
chaley is offline   Reply With Quote