View Single Post
Old 02-24-2014, 11:44 PM   #16
Purple Lady
Grand Sorcerer
Purple Lady ought to be getting tired of karma fortunes by now.Purple Lady ought to be getting tired of karma fortunes by now.Purple Lady ought to be getting tired of karma fortunes by now.Purple Lady ought to be getting tired of karma fortunes by now.Purple Lady ought to be getting tired of karma fortunes by now.Purple Lady ought to be getting tired of karma fortunes by now.Purple Lady ought to be getting tired of karma fortunes by now.Purple Lady ought to be getting tired of karma fortunes by now.Purple Lady ought to be getting tired of karma fortunes by now.Purple Lady ought to be getting tired of karma fortunes by now.Purple Lady ought to be getting tired of karma fortunes by now.
 
Purple Lady's Avatar
 
Posts: 5,698
Karma: 16542228
Join Date: Feb 2010
Location: Pennsylvania
Device: Huawei MediaPad M5, LG V30, Boyue T80S, Nexus 7 LTE, K3 3G, Fire HD8
Quote:
Originally Posted by chaley View Post
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:
Code:
{#read}
Quote:
Originally Posted by kaufman View Post
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
Purple Lady is offline   Reply With Quote