View Single Post
Old 06-22-2011, 01:06 PM   #8
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,382
Karma: 27756918
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
@kiwidude: First, format_abspath remains in place until the new db backend is completed, so you dont have to do anything right away. All you need to do right away, is check uses of cover() and format(). Replace the former with abspath(id)+'/cover.jpg' and the latter with format_abspath.

Second, if your plugins already make copies there is no need to make copies of copies, simply use db.copy_format_to to make your first copy. Or use the path returned by db.format(..., as_path=True) as your copy.

When it comes to opening files in external editors, I don't really see a solution short of launching the external process with a temp file and then watching the file in a thread. Whenever the file changes, you update it in the calibre library. If you like, I can help you by adding code to implement cross platform file change notification in the calibre core.

@chaley: Yes, that's the idea, it also makes the library store much more robust, since it prevents multiple processes/threads from writing to the same file at once (or in windows throwing an error).
kovidgoyal is offline   Reply With Quote