View Single Post
Old 02-02-2015, 10:38 PM   #6
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,440
Karma: 27757438
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Yes, in the identify() method it wont work, since that is run in a worker process. Because of your previous questions, I somewhat sloppily assumed you meant the url_from_identifier() method.

You can just directly read for the database, with something like this,

Code:
import apsw
conn = apsw.Connection('/path/to/calibre/metadata.db', apsw.SQLITE_OPEN_READONLY)
apsw is multi-process/thread safe so it should be fine.
kovidgoyal is offline   Reply With Quote