Register Guidelines E-Books Search Today's Posts Mark Forums Read

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

Notices

Reply
 
Thread Tools Search this Thread
Old 01-20-2011, 12:19 PM   #136
assur191
Junior Member
assur191 began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Jan 2011
Device: Kindle
Custom Pegboard Request

I just purchased a Kindle, and I wish to have the title of each book include not only the series name, but also the over-arching meta series name and index, if available. For example:

The book "Rogue Squadron" is book one of the series "X-Wing", which is itself a part of the meta-series "Star Wars". I would like the title to appear as "Star Wars: X-Wing - 01 - Rogue Squadron". I have created a custom field in Calibre titled "Meta Series" which holds the data "Star Wars". I'd want to be sure that the colon or dash marks don't appear if there is nothing in the fields.

How would I go about setting up a pegboard for this? Any help is appreciated.

Thank you.
assur191 is offline   Reply With Quote
Old 01-23-2011, 05:23 AM   #137
pchrist7
Addict
pchrist7 is kind to children and small, furry animalspchrist7 is kind to children and small, furry animalspchrist7 is kind to children and small, furry animalspchrist7 is kind to children and small, furry animalspchrist7 is kind to children and small, furry animalspchrist7 is kind to children and small, furry animalspchrist7 is kind to children and small, furry animalspchrist7 is kind to children and small, furry animalspchrist7 is kind to children and small, furry animalspchrist7 is kind to children and small, furry animalspchrist7 is kind to children and small, furry animals
 
pchrist7's Avatar
 
Posts: 385
Karma: 6514
Join Date: Aug 2010
Location: Denmark
Device: Kindle 3 3G+Wifi
Cool Kindle: Show ebook reading status in custom column

Hi All
The following HOWTO was developped in another thread.

Chaley suggested to put it here as well.

Do you have a Kindle ?
Did you ever want Calibre to show "Read Status" of your books in a column ?
Automagically ?

Then the following might for you as well.

You must be running Calibre 0.7.40 or newer to use this.
Also you must use "Fetch annotations" from you Kindle.

The following example is based on the following Kindler requirements:
"What I want is a custom column to show the "Last Opened" Date if Last location read > 95%.
If the book shows >0% but < 95%, I want the column to show "Reading"
And if the book is 0%, or unopened, the column should show "Not Read".


Howto "Fetch annotations" from you Kindle:
Start Calibre,
Connect your Kindle, wait a bit,
Click on the arrow just to the right of the "Send to Device" icon,
choose "Fetch Annotations"
and the Kindle "Book status" is added to the Calibre book details, in the comments.

You should Fetch fresh Annotations everytime you connect your Kindle to get updated information.

This is just an example of what I could get with my K3:

25-12-2010
Last Page Read: Location 7365 (68%)
Location 4603 • Bookmark
Location 4942 • Bookmark
Location 4980 • Bookmark
Location 5984 • Bookmark
Location 7363 • Bookmark


The best/fastest way, but hardest way, to get the needed information into a custom column, is to use Python Template functions.
Sounds scary, but don't worry. Copy/paste is your helper

Simply do as follows:

1) go to Preferences -> Advanced -> Template Functions.

2) in the Function box type: kindle_read_status

3) in the Arg count box type: 4

4) in the Documentation box, paste the following:

Code:
Check if the associated field contains a kindle annotation for percent read. 
If not, return no_page_read_str. 
If annotations are found, then compare that percent against is_read_pct. 
If the val is larger, then return date, 
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(95,Not Read,Reading)}
( use the above when defining your custom column )

95 goes into variable is_read_pct
Not Read goes into variable no_page_read_str
Reading goes into variable is_reading_str

Feel free to change the %, the test strings to suit your needs.
Do this in the custom column definition.
5) In the Program Code box, paste the following:
Code:
def evaluate(self, formatter, kwargs, mi, locals, val, is_read_pct,  
				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 date
		elif f > 0:
			return is_reading_str + ': ' + pct + '%'
	except:
		pass
	return no_page_read_str
6) press the Create button, then the Apply button.

7) Still in Preferences, Choose Add your own columns

8) Choose Add custom column bar at the bottom

9) enter the following into your custom column:
Lookup name: read_status
Column Heading: Read Status
Column type: Column built from other columns
Template:
Code:
{comments:kindle_read_status(95,Reading,Not Read)}
10) Choose Apply

11) Click Ok to the Restart Warning

12) Shutdown Calibre

13) Start Calibre

If you followed instructions minutely, you should have a new column showing the "Read Status" for your books.

If you like this functionality, please remember to send some Karma to chaley
http://www.mobileread.com/forums/rep....php?p=1351864

He has been absolutely fantastic and helpfull with this.

If this fails, please try one more time before posting to this thread.
This has been tested by several Kindlers succesfully.

Enjoy

Note: If you want a text returned instead of a date when a book is read
have a look here:
http://www.mobileread.com/forums/sho...&postcount=172

Last edited by pchrist7; 04-26-2011 at 10:01 AM. Reason: Make it work for K2, KDX. Year was 4 digits and gave problems for these readers
pchrist7 is offline   Reply With Quote
Old 01-24-2011, 01:58 AM   #138
nynaevelan
eBook Junkie
nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.
 
nynaevelan's Avatar
 
Posts: 1,447
Karma: 1459924
Join Date: May 2010
Location: USA
Device: Kindle Fire 6 2014, Kindle PW2, Galaxy Note 3
Very interesting, one question though: Why does this new column not show up in the columns section on the left? Now I have to go "read" books I have already read so that they are all registering correctly. Thank you all for this one.

Nyn
nynaevelan is offline   Reply With Quote
Old 01-24-2011, 02:12 AM   #139
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 8,861
Karma: 12755553
Join Date: Feb 2009
Location: North Carolina
Device: Nexus 7
Quote:
Originally Posted by nynaevelan View Post
Very interesting, one question though: Why does this new column not show up in the columns section on the left?
Maybe calibre has to be restarted for this to show there.
DoctorOhh is offline   Reply With Quote
Old 01-24-2011, 02:20 AM   #140
nynaevelan
eBook Junkie
nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.
 
nynaevelan's Avatar
 
Posts: 1,447
Karma: 1459924
Join Date: May 2010
Location: USA
Device: Kindle Fire 6 2014, Kindle PW2, Galaxy Note 3
Quote:
Originally Posted by dwanthny View Post
Maybe calibre has to be restarted for this to show there.
No, a restart does not produce it either, but no big deal.

One more question: Is there a way to adjust the template to pull the annotations from K4PC, since that is easier to use to go back to adjust the locations for the books?
nynaevelan is offline   Reply With Quote
Old 01-24-2011, 02:30 AM   #141
nynaevelan
eBook Junkie
nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.
 
nynaevelan's Avatar
 
Posts: 1,447
Karma: 1459924
Join Date: May 2010
Location: USA
Device: Kindle Fire 6 2014, Kindle PW2, Galaxy Note 3
Quote:
Originally Posted by nynaevelan View Post
One more question: Is there a way to adjust the template to pull the annotations from K4PC, since that is easier to use to go back to adjust the locations for the books?
Nevermind, I can just manually copy them from the k4pc directory to the kindle.
nynaevelan is offline   Reply With Quote
Old 01-24-2011, 04:59 AM   #142
nynaevelan
eBook Junkie
nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.
 
nynaevelan's Avatar
 
Posts: 1,447
Karma: 1459924
Join Date: May 2010
Location: USA
Device: Kindle Fire 6 2014, Kindle PW2, Galaxy Note 3
Me again, I am having a little trouble with where the data is being inputted from the annotation. This is what the format is:

Code:
1/24/2011
Last Page Read: Location 721 (99%)
But with that data it is adding a + to the tags field and 1/24/2011 to the read-status field. How do I get it to not add anything to the tags field and to add the read status with the percentage to the read_status field?
nynaevelan is offline   Reply With Quote
Old 01-24-2011, 05:34 AM   #143
pchrist7
Addict
pchrist7 is kind to children and small, furry animalspchrist7 is kind to children and small, furry animalspchrist7 is kind to children and small, furry animalspchrist7 is kind to children and small, furry animalspchrist7 is kind to children and small, furry animalspchrist7 is kind to children and small, furry animalspchrist7 is kind to children and small, furry animalspchrist7 is kind to children and small, furry animalspchrist7 is kind to children and small, furry animalspchrist7 is kind to children and small, furry animalspchrist7 is kind to children and small, furry animals
 
pchrist7's Avatar
 
Posts: 385
Karma: 6514
Join Date: Aug 2010
Location: Denmark
Device: Kindle 3 3G+Wifi
Hmm

Quote:
Originally Posted by nynaevelan View Post
Me again, I am having a little trouble with where the data is being inputted from the annotation. This is what the format is:

Code:
1/24/2011
Last Page Read: Location 721 (99%)
But with that data it is adding a + to the tags field and 1/24/2011 to the read-status field. How do I get it to not add anything to the tags field and to add the read status with the percentage to the read_status field?
Hi
I can confirm that something is going on with the tags, adding a +
Don't use/show tags myself, so this I missed.
Will try to find out what/why, but still new to this.

The example will only return one value. The example wanted to use 95% as the comparison value.
Try changing you costum column definition to
Code:
{comments:kindle_read_status(99,Reading,Not Read)}
pchrist7 is offline   Reply With Quote
Old 01-24-2011, 05:44 AM   #144
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 8,861
Karma: 12755553
Join Date: Feb 2009
Location: North Carolina
Device: Nexus 7
Quote:
Originally Posted by pchrist7 View Post
Hi
I can confirm that something is going on with the tags, adding a +
Don't use/show tags myself, so this I missed.
Will try to find out what/why, but still new to this.[/CODE]
I don't know why a + is being added as a tag, but when creating a catalog in calibre I believe every book that has a + as a tag is treated as read.

Last edited by DoctorOhh; 01-24-2011 at 06:22 AM.
DoctorOhh is offline   Reply With Quote
Old 01-24-2011, 06:18 AM   #145
pchrist7
Addict
pchrist7 is kind to children and small, furry animalspchrist7 is kind to children and small, furry animalspchrist7 is kind to children and small, furry animalspchrist7 is kind to children and small, furry animalspchrist7 is kind to children and small, furry animalspchrist7 is kind to children and small, furry animalspchrist7 is kind to children and small, furry animalspchrist7 is kind to children and small, furry animalspchrist7 is kind to children and small, furry animalspchrist7 is kind to children and small, furry animalspchrist7 is kind to children and small, furry animals
 
pchrist7's Avatar
 
Posts: 385
Karma: 6514
Join Date: Aug 2010
Location: Denmark
Device: Kindle 3 3G+Wifi
Thats it

Quote:
Originally Posted by dwanthny View Post
I don't know why a + is being added as a tag, but when creating a catalog in calibre I believe every book that has a + as a tag treated as read.
Hi dwanthny
Yep - did a lot of Googling, to confirm this.
I'm sure that the + is added by "Fetch Annotations", no matter which custom columns you might have had.
I would guess the idea was to Mark a book "read" by adding the + to the tags. This was way before custom columns etc.
Not sure what value for inserting the + is
pchrist7 is offline   Reply With Quote
Old 01-24-2011, 06:23 AM   #146
pchrist7
Addict
pchrist7 is kind to children and small, furry animalspchrist7 is kind to children and small, furry animalspchrist7 is kind to children and small, furry animalspchrist7 is kind to children and small, furry animalspchrist7 is kind to children and small, furry animalspchrist7 is kind to children and small, furry animalspchrist7 is kind to children and small, furry animalspchrist7 is kind to children and small, furry animalspchrist7 is kind to children and small, furry animalspchrist7 is kind to children and small, furry animalspchrist7 is kind to children and small, furry animals
 
pchrist7's Avatar
 
Posts: 385
Karma: 6514
Join Date: Aug 2010
Location: Denmark
Device: Kindle 3 3G+Wifi
Quote:
Originally Posted by nynaevelan View Post
How do I get it to not add anything to the tags field ?
Hi nynaevelan
That's out of my control.
This added by "Fetch Annotations" to mark the book "read".
pchrist7 is offline   Reply With Quote
Old 01-24-2011, 07:29 AM   #147
chaley
"chaley", not "charley"
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 5,626
Karma: 857074
Join Date: Jan 2010
Location: France
Device: Many android devices
I looked at the code. It is using the 'Read tag' value from the catalog options, which defaults to a '+'. My guess is that you can turn off adding the tag by emptying that option in catalog setup.
chaley is offline   Reply With Quote
Old 01-24-2011, 08:30 AM   #148
nynaevelan
eBook Junkie
nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.
 
nynaevelan's Avatar
 
Posts: 1,447
Karma: 1459924
Join Date: May 2010
Location: USA
Device: Kindle Fire 6 2014, Kindle PW2, Galaxy Note 3
Quote:
Originally Posted by chaley View Post
I looked at the code. It is using the 'Read tag' value from the catalog options, which defaults to a '+'. My guess is that you can turn off adding the tag by emptying that option in catalog setup.
Where would this be done?
nynaevelan is offline   Reply With Quote
Old 01-24-2011, 08:31 AM   #149
nynaevelan
eBook Junkie
nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.nynaevelan ought to be getting tired of karma fortunes by now.
 
nynaevelan's Avatar
 
Posts: 1,447
Karma: 1459924
Join Date: May 2010
Location: USA
Device: Kindle Fire 6 2014, Kindle PW2, Galaxy Note 3
Quote:
Originally Posted by pchrist7 View Post
Hi nynaevelan
That's out of my control.
This added by "Fetch Annotations" to mark the book "read".
If I remove this value manually, will it break anything later when I do another sync?
nynaevelan is offline   Reply With Quote
Old 01-24-2011, 08:47 AM   #150
chaley
"chaley", not "charley"
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 5,626
Karma: 857074
Join Date: Jan 2010
Location: France
Device: Many android devices
Quote:
Originally Posted by nynaevelan View Post
Where would this be done?
Click the dropdown arrow on Convert Books or right-click on a book in the library view, choose 'create catalog', select Epub or Mobi, change the option near the middle of the page, and push Apply.

I have no way of testing if making this change actually accomplishes what you want.
chaley is offline   Reply With Quote
Reply

Tags
custom column

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
custom column i need a little help shinken Calibre 3 09-15-2010 03:41 AM
Using Custom Metadata in Save Template EJvdH Calibre 1 07-02-2010 06:06 AM
Accessories Decalgirl Kindle 2 custom skin template srmalloy Amazon Kindle 6 04-09-2010 09:55 PM
Donations for Custom Recipes ddavtian Calibre 5 01-23-2010 04:54 PM
Help understanding custom recipes andersent Calibre 0 12-17-2009 02:37 PM


All times are GMT -4. The time now is 10:07 AM.


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