05-01-2010, 11:52 PM | #1 |
Junior Member
Posts: 3
Karma: 10
Join Date: May 2010
Device: iPhone
|
self.author in MetadataSource plugin
I started writing a metadata download plugin according to the documentation in the user manual, but I'm having some trouble with the self.author value. It looks like a naming conflict between the author of the plugin and the author of the book. Has anyone else run into this and already solved it?
This code demonstrates the issue. The value for self.title is the book title, but the value for self.author in this example is "Wrong Author" instead of the book author: Code:
import traceback from calibre.ebooks.metadata.fetch import MetadataSource class AuthorConflictPlugin(MetadataSource): name = 'foo' author = 'Wrong Author' supported_platforms = ['windows'] metadata_type = 'basic' def fetch(self): try: raise Exception(self.title, self.author) # value is Wrong Author except Exception as e: self.exception = e self.tb = traceback.format_exc() |
05-02-2010, 12:49 AM | #2 |
creator of calibre
Posts: 44,303
Karma: 23661992
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Use self.book_author instead of self.author
|
Advert | |
|
05-02-2010, 01:24 AM | #3 |
Junior Member
Posts: 3
Karma: 10
Join Date: May 2010
Device: iPhone
|
That worked. Thank you.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Get to Know-an Author with Noahan Author Interview series! | NoahMGillman | Self-Promotions by Authors and Publishers | 22 | 12-19-2010 09:45 PM |
New Plugin Type Idea: Library Plugin | cgranade | Plugins | 3 | 09-15-2010 12:11 PM |
The 50 best author vs. author put-downs of all time | Madam Broshkina | Lounge | 4 | 05-03-2010 05:13 AM |
Author(s) & Author Sort | BobF | Calibre | 11 | 01-02-2009 05:01 PM |
Referencer plugin | IanHelgesen | iRex | 6 | 12-22-2008 09:24 PM |