Quote:
Originally Posted by chaley
You can probably use the template in your composite column:
Code:
{#mybool:switch(yes,read,no,unread,)}
instead of this one that you are probably using now:
|
Quote:
Originally Posted by kaufman
No problem, its was just an idea. I'm not invested in it that much. I just thought it might be easier for everyone.
By the way, you can do a lot with Calibre and custom columns using tags. I used to use separate columns for a lot of things because I didn't know how to do it with a tag. Some helpful person on Mobileread showed me how to do it with a small program block. If you are interested, take a look at:
https://www.mobileread.com/forums/sho....php?p=2761871
|
I'm using a template function - I copied something Chaley did for someone for the sub collections for Sony PRS+ to start with and changed it to suit me. I have categories that I want as a top level collection, and genres that I want to combine with the #read column. I used to have series and author collections as well, but CC takes care of those.
Code:
def evaluate(self, formatter, kwargs, mi, locals, cats, genre):
categories = set([v.strip() for v in cats.split(',') if v.strip()])
genres = set([v.strip() for v in genre.split(',') if v.strip()])
res = []
tags = [v.strip() for v in kwargs.get('tags') if v.strip()]
isread = kwargs.get('#read')
for v in tags:
if v in categories:
res.append(v)
elif v in genres:
if isread:
res.append('Genre ' + isread+ '|' + v)
else:
res.append('Genre|' + v)
elif isread:
res.append(isread + '|' + v)
else:
res.append('stuff|' + v)
if isread:
res.append(isread)
return ', '.join(res)
I end up with these groupings:
Borrowed, Genre unread|Non Fiction, unread
read|-bought, Genre read|Mystery - Thriller, read
unread|-free, Genre unread|Science Fiction, unread