View Single Post
Old 02-17-2012, 12:10 AM   #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,398
Karma: 27756918
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
A file type plugin is not the right place to do this and you really shouldn't create an extra db instance. Having multiple db objects writing to the same db is a recipe for bad things to happen. In fact on windows, you will get permission denied errors since windows enforces mandatory file locking.

Instead create a replacement for the add books plugin (you can re-use the calibre add books code for the most part) and have that plugin scan newly imported book records for ones that contain only a single format, and launch a convert for them, by calling the convert books plugin.
kovidgoyal is offline   Reply With Quote