View Single Post
Old 07-07-2017, 03:54 PM   #21
jeffls
Junior Member
jeffls began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Jul 2017
Device: android
Quote:
Originally Posted by kovidgoyal View Post
Metadata source plugins have a pretty trivial API. Basically you just need to implement a single method, the identify() method. And optionally the download_cover() method. Just look at any metadata download plugin for examples.
I've looked at several and still having a problem. I can actually get my code to use the amazon api and obtain the fields I want, but it's not clear what magic gets these back into the calibre database.

Most all of the example code uses the worker capabilities, and I'm have a serious issue getting calibre-customize to import from any module file I create. For example:
1. I have two files: "__init__.py" and "worker.py"

2. worker.py has a class named "Worker"

3. My class in __init__.py has the following line:

name = 'Amazon Genre Tags'

4. in my init.py file I try: (note: my plugin is named 'Amazon Genre Tags')

from calibre_plugins.amazon_genre_tags.worker import Worker

Result: The calibre-customize -b command will always file with the following error:

ImportError: No module named amazon_genre_tags.worker

It's there, I can't figure out what the problem is. I'm probably too dense to learn strictly from examples and need more direct step-by-step instructions.
jeffls is offline   Reply With Quote