@kovid: I looked at the merge_metadata() method in the edit_metadata action. It is very self contained. I copied it to a python template and ran it with almost no changes. Metadata from my test books was merged. Of course it doesn't do anything with formats and doesn't delete any books.
If I move it from the GUI to ebook.metadata.book then it could be used in scripts executed with 'calibre-debug -e' as well as be used by some eventual command line utility (that I am not volunteering to write). A stub must remain in edit_metadata to pass the db to the moved method.
I could do the same thing with merge_data_files(), but I don't think it is necessary. The only thing is does is call the db api merge_extra_files() method.
Is this OK with you?
|