View Single Post
Old 12-18-2010, 04:45 PM   #20
mornington
Connoisseur
mornington will become famous soon enoughmornington will become famous soon enoughmornington will become famous soon enoughmornington will become famous soon enoughmornington will become famous soon enoughmornington will become famous soon enoughmornington will become famous soon enough
 
Posts: 63
Karma: 732
Join Date: Nov 2010
Device: Sony PRS-650
Quote:
Originally Posted by beckywc View Post
I have a custom column thats called "In Collection" this column is a text, but with a set of permitted values. These values are the collections I have currently on my Kindle. When I add a book to my library I select which collection it will go in.

How would I be able to alter you script to fit my set up?

Thanks
Pretty much the same as for tags/authors/series, except that you'd be retrieving the values from a custom column instead. Those values are also stored in calibre.metadata but you may need to dig a little deeper into the json structure to extract them.

You can open your calibre.metadata in a text editor to see exactly how its structured (and so from where you need to extract the values you want): It's just a json format structure.

Probably it'd be something like this to obtain the values to parse (based on a quick glance at the json structure just now - I've not tested this at all):

Code:
mycustom = book["user_metadata"]["#mycustomcolumnid"]["#value#"]
So, parse the calibre data in parseCalibreMetadata() then use your parsed data to build your collections in createCollectionsFromCalibre(). Follow through how this is done for tags and you should be able to handle your custom column similarly.
mornington is offline   Reply With Quote