View Single Post
Old 10-01-2023, 04:33 PM   #13
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,475
Karma: 8025702
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
@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?
chaley is offline   Reply With Quote