View Single Post
Old 12-22-2020, 01:55 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,450
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by chris33 View Post
AFAIK there is no opf import, so I need to import metadata values one by one.
Does calibre.ebooks.metadata.opf.set_metadata do what you want?

Also, calibre.db.cache.get_metadata() returns the metadata for a given book id. You can get a db object using gui.library_view.model().db, which gives you access to the methods in db.legacy. You probably want to use gui.library_view.model().db.new_api so you can use the newer methods in db.cache.
chaley is offline   Reply With Quote