Viewer plugins have no access to the database. They cannot since the the viewer can be run on books outside of a calibre library as well. I assume what you want to do is have calibre run embed metadata automatically when you click the view button?
If so, create a calibre plugin that duplicates the builtin view plugin, except that it run the embed metadata plugin before opening the file in the viewer. Then you can use this plugin to replace the view button in your calibre.
|