Metadata knowing bookID (outside the ui)
I have found in good examples of getting a calibre.ebook.Metadata object given a bookId but so far I have only seen it in InterfaceAction plugins (they get everything they need to get to the gui.db in __init__).
I'm trying to run do the same thing (get Metadata knowing a bookid) but from a Source plugin running in cli mode (calibre-debug -r "mypluginname").
I saw that there is a show_metadata method in calibredb and that seemed promising because it's the same no-ui context but I got lost trying to find where the contextdb that command uses to access the database is created.
Could anyone point me to an example that would show how to get to the book metadata knowing the bookid when the context is a "no ui" loaded context?
|