View Single Post
Old 04-28-2011, 02:42 PM   #200
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: 12,509
Karma: 8065348
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by kiwidude View Post
Phew, all fixed now, thx guys.

I guess the next decision is whether to make this a background job or just make the user wait. On a 1500 book/4000 format library it takes around 15 seconds.
Make'em wait. The computer will get lonely.

On a more serious note, as you are almost certainly using os.stat, you have the mtime as well as the size. You may consider storing those two values and the hash (I imagine you got rid of the double hash) of each format with the book, using the plugin storage facility. Check the size+mtime before recomputing the hash, and use the stored hash if the values haven't changed.
chaley is offline   Reply With Quote