Quote:
Originally Posted by chaley
This inspires me to give you a solution. You can use a custom template function in a "column built from other columns".
The steps: - Create the template function by going to Preferences / Advanced / Template Functions.
- Give the template a name. In this example I named it length_of_longest_author.
- Put a -1 in the Argument count box because the function takes no arguments.
- 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
- 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.
|
That was my thought as well the performance hit using dynamic columns could be very large. Modifying the word count plugin to count author name size would be I think faster plus as the op needs the count for 1 time cleaning only wont require the columns to be updated with each author change.