The indentation of the run method is incorrect. And for metadatawriter plugins you need to implement the set_metadata method, not the run method.
Also I'm not sure what you are expecting to do here. If you want to add metadata based on newly added book files to the calibre databse you need to create a filetype plugin not a metadatawriter plugin.
Create a filetype plugin and implement either the postimport() or postadd() methods in it.
|