webengine-dialog and database connection
#1  pl000070 11-20-2019, 02:40 AM
Hello All,

Please help on how to connect to current database from another Calibre instance with webengine-dialog.

I just registered to ask this question. I've got a private plugin that allows to find book metadata by manual search in the Internet (I noticed that sometimes standard import metadata plugins are completely lost e.g. when book title is short and non-unique). Recently I upgraded to Calibre 4 and discovered QWebEngineView. I implemented webengine-dialog but I have problem how to connect to current database without active GUI. I need to store metadata read from Web page. I don't know how to use RC signal as it seems that list of possible functions is hardcoded, so I think I need to write directly to database.

Thanks in advance for any help.

#2  pl000070 11-20-2019, 02:49 AM
Just to add to my question: I tried to use
from calibre.library import db
but I cannot use db afterwards.

#3  kovidgoyal 11-20-2019, 10:13 PM
You cannot connect to a database from webengine-dialog. Instead have your webengine-dialog process store the metadata in a temp file/folder and read it from there in the main process after the dialog is closed.

#4  pl000070 11-21-2019, 05:41 PM
Thank you very much for the advice and quick answer. I'll do this way. Topic closed.

Today's Posts | Search this Thread | Login | Register