View Single Post
Old 04-07-2023, 05:34 AM   #3
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,489
Karma: 8065348
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by haertig View Post
My first thought to fix this was to use the function shorten() in the plugboard to truncate the series name and add an ellipsis on the end. But the Calibre documentation says that you should not use a function in a plugboard template.
Where does it say that, because it is wrong and needs changing. Plugboards templates aren't special. There might be some restriction on using GUI-only functions in a plugboard, but I don't think so.

One possibility that extends on @ownedbycats idea is to use a combination of a stored template and a custom text column. The stored template first checks if the column contains a value, returning it if so. If the column doesn't contain a value then the template computes the "default" result however you wish.

Using a stored template makes it easier to test and maintain. Using a column as an override means you change only the books for which the template produces an undesired result. Removing the value from the column for a book automatically reverts back to the algorithm.

EDIT: Rereading I see you anticipated my idea. Sorry about the noise.
chaley is offline   Reply With Quote