View Single Post
Old 09-07-2022, 03:53 AM   #28
un_pogaz
Chalut o/
un_pogaz ought to be getting tired of karma fortunes by now.un_pogaz ought to be getting tired of karma fortunes by now.un_pogaz ought to be getting tired of karma fortunes by now.un_pogaz ought to be getting tired of karma fortunes by now.un_pogaz ought to be getting tired of karma fortunes by now.un_pogaz ought to be getting tired of karma fortunes by now.un_pogaz ought to be getting tired of karma fortunes by now.un_pogaz ought to be getting tired of karma fortunes by now.un_pogaz ought to be getting tired of karma fortunes by now.un_pogaz ought to be getting tired of karma fortunes by now.un_pogaz ought to be getting tired of karma fortunes by now.
 
un_pogaz's Avatar
 
Posts: 446
Karma: 672378
Join Date: Dec 2017
Device: Kobo
Yep, the ePub can already contain an "author_sort" value and Calibre will import it as is, so be careful with it.

A simple solution is to use Action Chains and install the script Bulk Sort. This solution will rebuild all author_sorts based on the DB value.

A more advanced solution with template function:
@BetterRed you may be interested

Create the template function valid_author_sort()
Code:
program: ifelse($author_sort, author_sorts(' & '), '1', '0')
when the ifelse() allows a sensitive comparison to the text:
Code:
def evaluate(self, formatter, kwargs, mi, locals, x, y, yes, no):
    if str(x) == str(y):
        return yes
    else:
        return no
Personally, I use it to color the columns in red when "author_sort" is invalid, and as well as a saved search for quick check ma library. No need to have it in book details, one line saved.
Code:
template:"program:valid_author_sort()#@#:t:0"
And this is much faster than launching Quality Check, no need a space scraft for travel across the street.

Last edited by un_pogaz; 09-07-2022 at 03:56 AM.
un_pogaz is offline   Reply With Quote