Getting custom metadata field in GUI plugin
Hi all,
Recently I have started to use Calibre to transfer files to Kindle and found that APNX file is generated and books have "page numbers". However, APNX generator by John Schember is calculating page numbers in it's own algorithms.
I myself want a possibility to provide page number to the generator myself. Contacted John with few questions, but he did not want to waste his time, so simply gave me sources. I have no knowledge with Python at all, but have an idea about coding so changed his plugin so far, that I can enter desired page count for a book and generate appropriate APNX file.
Unfortunately, page count is hardcoded, so for any book I am going to read I need to change and reload the plugin. Silly way, of course.
So I want to enhance that plugin in the following way: add custom metadata field, call it "Page Count" and put page count of appropriate book into it. When I select that book and then click "Generate APNX File", plugin should read the value from that field and use it for APNX generation.
As I am unfamiliar with Calibre internals, could you please give me simple source example: what to import, how to get the metadata object for selected book(s) and how to read particular custom metadata column.
Regards,
Saulius P.
|