Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 04-12-2018, 01:18 AM   #16
Tatjana
Coffee Girl
Tatjana began at the beginning.
 
Tatjana's Avatar
 
Posts: 16
Karma: 10
Join Date: May 2014
Device: no money for such things
Quote:
Originally Posted by chaley View Post
This inspires me to give you a solution. You can use a custom template function in a "column built from other columns".

The steps:
  1. Create the template function by going to Preferences / Advanced / Template Functions.
  2. Give the template a name. In this example I named it length_of_longest_author.
  3. Put a -1 in the Argument count box because the function takes no arguments.
  4. Put this text in the Program code box:
    Code:
    def evaluate(self, formatter, kwargs, mi, locals):
    	authors = mi.get('authors')
    	if authors:
    		return max([len(a) for a in authors])
    	return 0
    The following screen capture shows the example
    Attachment 163238
  5. Create a custom column "built from other columns. Name it whatever you want. Set the template to
    Code:
    program: length_of_longest_author()
    using the name you used for the custom template function. Set the Sort/Search box to "Number". Check the "Show in Tag browser" box if you want to see the values in the tag browser. The following screen capture shows my example.
    Attachment 163239
It will be interesting to see what performance this has on your large library.
This is my dream came true! It works perfectly and without noticeable impact on performance (I replaced my original AL column with this one).

Thank you so very much, for your kindness, for your generosity, and for your time!
Tatjana is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Move selected data from series column to a new custom column fvdham Library Management 3 06-02-2017 03:49 PM
Custom COlumn: Author Sort - Series BzKevin Library Management 4 10-20-2014 09:27 AM
Sony book sorting by author fails when creating collections from a custom column speakingtohe Devices 2 05-15-2014 01:27 PM
Custom column returns value based on value of another custom column? calvin-c Calibre 3 09-14-2013 02:24 PM
Custom column showing path length? xterminal Library Management 1 09-11-2012 09:12 AM


All times are GMT -4. The time now is 07:52 PM.


MobileRead.com is a privately owned, operated and funded community.