View Single Post
Old 07-03-2011, 05:54 AM   #99
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,741
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by kiwidude View Post
Forgot to also make this change in 1.1.2 - again for an internal Calibre codebase change that would break this plugin in future. This plugin now uses the db.format_hash() and db.format_metadata() functions Kovid added in 0.8.7 as detailed in this thread.
Another thing you might want to know...

Starting with the next release, format_metadata caches the data returned by os.stat() during a given calibre session. If a format is changed outside of calibre, then the cache will be incorrect, containing stale data. For example, calibre won't know the file has changed if you use open_with and sigil to change it, so format_metadata can return stale data.

The cache is not persistent. It is rebuilt every time calibre starts, which limits the lifetime of the stale data.

EDIT: I should also point out that format_metadata() has a new additional argument that indicates whether or not it is permissible to use the cache.

Last edited by chaley; 07-03-2011 at 05:58 AM.
chaley is offline   Reply With Quote