08-23-2012, 05:45 PM | #1 |
Enthusiast
Posts: 27
Karma: 30
Join Date: Jul 2011
Device: none
|
How to access a books series index from within Source.identify?
I'm trying to write my first plugin, and learn Python for the first time. I'm a Java programmer. My plugin will "download" metadata, so I'm subclassing "Source" and overriding "identify"
My plugin will need the series index of each book, but I do not know where the value is. It doe not seem to be in any of the arguments passed to identify, and my attempt to use the identifiers argument is hopeless: Code:
def identify(self, log, result_queue, abort, title=None, authors=None, identifiers=['series'], timeout=30): #no luck here return None |
08-23-2012, 06:32 PM | #2 |
Calibre Plugins Developer
Posts: 4,678
Karma: 2162246
Join Date: Oct 2010
Location: Australia
Device: Kindle Oasis
|
@charlweed - I moved your questions into the Development forum - just a slightly better place to ask them (I appreciate they are plugin related, we just try to keep the really geeky stuff in here).
Your best bet is to look at the source for one of the existing plugins - there are loads of them available. I suggest you pick one of the simpler ones like B&N which I know a number of the metadata plugin authors based theirs on. In direct answer to your question - the purpose of the identify function is to find possible book candidates to launch a Worker process to *actually* perform the metadata download. So identify() usually fires a "search" type of query, parsing the search results to decide possible matches, and then the Worker thread(s) for each candidate queries the detail page for that book and constructs a Metadata object, which amongst its attributes can include .series and .series_index |
Advert | |
|
08-24-2012, 08:27 PM | #3 |
Enthusiast
Posts: 27
Karma: 30
Join Date: Jul 2011
Device: none
|
Hmm, sounds a bit tricker then I expected. Here is the truth. I'm not really going to download anything, the metadata and book covers are already on my local filesystem, but with strange filenames and directory names, which can be re-generated from the book's title,author, and series index.
Actually, I'm going to download and read the code for several other MD downloaders, to get a better understanding of your posts. Thanks! |
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Auto Increment Series Index Tweak | penguinaka | Calibre | 16 | 07-30-2011 07:17 PM |
Series Index Auto Increment | lgladen | Calibre | 4 | 04-14-2011 09:14 AM |
Command Line problems: ebook-convert, ebook-meta with tags: --series, --series-index | omnivorous | Calibre | 4 | 11-07-2010 02:42 PM |
Format of Series index when sending to device | Yirabeth | Calibre | 0 | 08-19-2010 04:41 PM |
Series index Save to Disk problem | Dopedangel | Calibre | 6 | 08-27-2009 04:54 PM |