View Single Post
Old 06-02-2013, 03:52 AM   #195
Terisa de morgan
Grand Sorcerer
Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.Terisa de morgan ought to be getting tired of karma fortunes by now.
 
Terisa de morgan's Avatar
 
Posts: 6,233
Karma: 11768331
Join Date: Jun 2009
Location: Madrid, Spain
Device: Kobo Clara/Aura One/Forma,XiaoMI 5, iPad, Huawei MediaPad, YotaPhone 2
Quote:
Originally Posted by PeterT View Post
You could probably handle this with a custom column which you would use as the source for the shelf column. Something like

Code:
{:'first_non_empty(field('Series'), field('author_sort'))'}
This would return the Series name if set, else, the author_sort field.

In case a book has no author (not sure if this IS possible) you could also use
Code:
{:'first_non_empty(field('Series'), field('author_sort'),'Uncategorized')'}
to ensure that books ended up on an Uncategorized shelf.

This would all be defined as a custom column in calibre preferences of type Column built from other columns, and then the lookup name would be used in the driver's shelf definition field (prepeneded by a # mark of course).
Thank you by the tip about "first_not_empty".
Terisa de morgan is offline   Reply With Quote