Mobileread
webengine-dialog and database connection
#1  pl000070 11-20-2019, 03: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.
Reply 

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

#3  kovidgoyal 11-20-2019, 11: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.
Reply 

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

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