View Single Post
Old 05-09-2012, 01:01 PM   #2
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,455
Karma: 27757438
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
If your plugin is running in the GUI process use the database like this

gui = get_gui()
db = gui.library_view.model().db
db.add_books(...)

see database2.py for the methods db supports.

If your plugin is running out of process use

calibredb add

As for getting files from the content server, its a simple URL scheme just look at a few of the urls generated by the content server for file downloads, or look at the code in server/content.py
kovidgoyal is offline   Reply With Quote