|  01-26-2011, 03:07 PM | #166 | 
| eBook Junkie            Posts: 1,526 Karma: 1464018 Join Date: May 2010 Location: USA Device: Kindle Fire 2020, Kindle PW2 | 
			
			I have actually seen a few 100% but it is not the percentages I am concerned with.  I am actually concerned with the reading.  For instance if the percentage is 90 or higher I would like it to say Read not Reading.
		 | 
|   |   | 
|  01-26-2011, 10:21 PM | #167 | 
| Groupie            Posts: 167 Karma: 2627964 Join Date: Aug 2010 Location: Alabama, USA Device: Kobo Libra 2, Kobo Clara 2e, Kobo Libra Colour, Kindle Paperwhite | 
			
			I've just recently begun using plugboards and have been trying to help a friend set them up as well. She has a particular way she likes her books to show up and I'm wondering if there is a way to edit the plugboard to reflect something similar.  My friend prefers her books to be sorted by series but look like this:  Would something like this work? {title} - (#{series_index:0>2s| - | - }) | 
|   |   | 
|  01-26-2011, 10:35 PM | #168 | |
| Well trained by Cats            Posts: 31,249 Karma: 61360164 Join Date: Aug 2009 Location: The Central Coast of California Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A | Quote: 
 1) there is No series, only a place (series_index)number in some (unknown) series  2) Depending on how your reader sorts (alpha-numeric is common), that list would tend to sort based upon the First letter (B, C, I, J, L, Po, Pu, R, S, W) Possibly, you want a Series folder/ The 2 digits of a Series Index (so 01, 02, 10 not 1, 10, 2,...) Then the title (having author before the relevant info may mess the sort if multiple, different authors in a series | |
|   |   | 
|  01-26-2011, 11:08 PM | #169 | 
| Groupie            Posts: 167 Karma: 2627964 Join Date: Aug 2010 Location: Alabama, USA Device: Kobo Libra 2, Kobo Clara 2e, Kobo Libra Colour, Kindle Paperwhite | 
			
			I have a vague idea of what you are trying to tell me there.   In other words, it's not going to work exactly the way she wants unless she changes her mind about how she wants her stuff to look. At the moment, she's been changing the publication dates on all of her series books so they will show up in order by series. Thanks for taking the time to help out! | 
|   |   | 
|  01-27-2011, 05:31 AM | #170 | |
| Addict            Posts: 385 Karma: 6514 Join Date: Aug 2010 Location: Denmark Device: Kindle 3 3G+Wifi, Oasis | Quote: 
 Then we need to change the python template to return "Read" instead of the date. We also need to changge the custom column definition. Will look at it later today. | |
|   |   | 
|  01-27-2011, 09:46 AM | #171 | 
| eBook Junkie            Posts: 1,526 Karma: 1464018 Join Date: May 2010 Location: USA Device: Kindle Fire 2020, Kindle PW2 | |
|   |   | 
|  01-27-2011, 11:50 AM | #172 | 
| Addict            Posts: 385 Karma: 6514 Join Date: Aug 2010 Location: Denmark Device: Kindle 3 3G+Wifi, Oasis | 
				
				Kindle_read_status_2
			 
			
			Hi Again   No problem This helps ME to expand my knowledge, when time & energy allows. ( had weird brain farts over this simple change. Not my day ?) OK - IF I have understood your request correctly, I suggest you create a new python template function, and a new custom column. Then You don't loose what you have. Follow the instruction in the original post, BUT change the step instructions with the ones listed below !!! The link to the original instructions: https://www.mobileread.com/forums/sho...31#post1353631 Replace the Original instruction step # with the following: step 2: kindle_read_status_2 step 3: 5 step 4: Code: Check if the associated field contains a kindle annotation for percent read. 
If not, return no_page_read_str. 
If so, then compare that percent against is_read_pct. 
If the val is larger, then return is_read_str, 
if the val is >0 and < is_read_pct return is_reading_str. 
Otherwise return is_not_read_str. 
One usage: {comments:kindle_read_status(90,Read,Reading,Not Read)} 
( use the above when defining your custom column ) 
90 goes into variable is_read_pct. IF pct_read > 90 the book is "read" The text returned is
Read goes into the variable is_read_str. This ex. returns the text Read
Reading goes into variable is_reading_str. IF pct_read >0 book the text "Reading" is shown with the percentage shown as well.
Not Read goes into variable no_page_read_str. IF none of the above catch, then "Not Read" is shown.
Feel free to change the %, the text strings to suit your needs. 
Remember: Do this in the custom column definition.Code: def evaluate(self, formatter, kwargs, mi, locals, val, is_read_pct, is_read_str,
				is_reading_str, no_page_read_str):
	try:
		test_val = int(is_read_pct)
	except:
		return 'is_read_pct is not a number'
	import re
	mg = re.match('.*\s(\d+[-/]\d+[-/]\d+).*?Last Page Read: Location \d+ \((\d+)%\)', val, re.I + re.DOTALL);
	if mg is None:
		return no_page_read_str
	date = mg.group(1)
	pct = mg.group(2)
	try:
		f = int(pct)
		if f > test_val:
			return is_read_str
		elif f > 0:
			return is_reading_str + ': ' + pct + '%'
	except:
		pass
	return no_page_read_strLookup name: read_status2 Column Heading: Read Status2 Column type: Column built from other columns Template: Code: {comments:kindle_read_status_2(90,Read,Reading,Not Read)}Or this won't work IF this doesn't work, please try to delete the NEW costum column, and the NEW python template. Restart Calibre and try once more. Hope this helps you with wishes. And it ain't even Xmas for quite a while   Last edited by pchrist7; 04-26-2011 at 09:30 AM. Reason: Make it work for K2, KDX. Year was 4 digits and gave problems for these readers | 
|   |   | 
|  01-27-2011, 11:50 AM | #173 | |
| Well trained by Cats            Posts: 31,249 Karma: 61360164 Join Date: Aug 2009 Location: The Central Coast of California Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A | Quote: 
 I did notice that you HAD done the 2 digit part. The limitation may be the Reader Device, not Calibre.: Calibre will sort Series in order. I said may be, because some reader devices have other ways to present their 'bookshelf' than a the simple file name base system. If you name the Model, someone may be able to come up with a solution for you. | |
|   |   | 
|  01-27-2011, 01:30 PM | #174 | 
| eBook Junkie            Posts: 1,526 Karma: 1464018 Join Date: May 2010 Location: USA Device: Kindle Fire 2020, Kindle PW2 | 
			
			THANK YOU, that works perfectly, and yes it is like Christmas after Christmas.      | 
|   |   | 
|  01-28-2011, 10:42 AM | #175 | 
| Groupie            Posts: 180 Karma: 558490 Join Date: Jan 2011 Device: Kindle 5, Amazon Fire 5th Gen, Moto Z Play Droid | 
			
			I would like to create a plugboard that: - Uses only the author's surname. - Abbreviates certain series titles (ie. Lord of the Rings = LOTR) - If the title of a book begins with "The," it is omitted (ie. The Hunger Games = Hunger Games) how do I do that (any of it)? edit: also, is there a possible way to return the series_index for books to correlate with the current highest value in Calibre held by the the index for that series? (ie. where Harry Potter only has 7 books, series_index is one digit, while Star Trek: New Frontier has 17 series books so its index has 2 digits) ... I suppose this would maybe be contingent on whether I had a book in a series that required multiple digits before it would change the number of leading zeroes for the other books. This is to say, that I would like to insert the series index into my titles via a plugboard, but I want to conserve as much screen real estate as possible for the actual title, so if I didn't need leading zeroes, it wouldn't insert them. Last edited by chyron8472; 01-28-2011 at 11:16 AM. | 
|   |   | 
|  01-28-2011, 11:01 AM | #176 | 
| Addict            Posts: 385 Karma: 6514 Join Date: Aug 2010 Location: Denmark Device: Kindle 3 3G+Wifi, Oasis | |
|   |   | 
|  01-28-2011, 12:44 PM | #177 | |
| Grand Sorcerer            Posts: 6,268 Karma: 16544702 Join Date: Sep 2009 Location: UK Device: ClaraHD, Forma, Libra2, Clara2E, LibraCol, PBTouchHD3 | Quote: 
 Code: Source template: {author_sort:re(([^\,]+)(\,|$)(.*),\1)}
Destination field: authors
Source template: {series:re(([^\s])[^\s]*(\s|$),\1)}{series_index:>2s|| - }{title}
Destination field: titleLast edited by jackie_w; 01-28-2011 at 12:50 PM. Reason: Caveat | |
|   |   | 
|  01-28-2011, 01:06 PM | #178 | |
| eBook Junkie            Posts: 1,526 Karma: 1464018 Join Date: May 2010 Location: USA Device: Kindle Fire 2020, Kindle PW2 | Quote: 
  EDIT: I was able to add some to yours but it tells me I need to spread some reputation around before giving to Chaley again, I guess I get that message because I gave him some Karma the other day for a separate issue?? Last edited by nynaevelan; 01-28-2011 at 01:10 PM. Reason: Additional comment | |
|   |   | 
|  01-29-2011, 12:58 AM | #179 | |
| Addict            Posts: 385 Karma: 6514 Join Date: Aug 2010 Location: Denmark Device: Kindle 3 3G+Wifi, Oasis | 
				
				Thank you
			 Quote: 
 I have same problem with more karma to chaley. Have a nice weekend, | |
|   |   | 
|  01-29-2011, 08:33 AM | #180 | |
| Well trained by Cats            Posts: 31,249 Karma: 61360164 Join Date: Aug 2009 Location: The Central Coast of California Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A | Quote: 
  You have to Karma someone else, before you can give more. The longer you are here (and post), you will see the number of 'Karma' points that you can give, grow. You can adjust that number down, to just say thanks.  (I like to bonus, Polite first posters that read and followed the posting guidelines  ) | |
|   |   | 
|  | 
| Tags | 
| custom column, tag, tags | 
| 
 | 
|  Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post | 
| Should composite columns appear in Grouped Searches? | ownedbycats | Library Management | 3 | 02-13-2021 03:43 PM | 
| Having problems with composite columns and save/send templates | Trel | Calibre | 4 | 09-26-2016 03:21 PM | 
| Tooltips for narrow columns | theducks | Library Management | 7 | 03-16-2015 10:58 PM | 
| Techniques to use plugboards, custom columns and templates | kovidgoyal | Library Management | 0 | 01-26-2011 04:21 PM |