View Single Post
Old 01-02-2021, 10:14 AM   #1040
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,482
Karma: 8025704
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by jindroush View Post
Hi guys,
can anyone responsible for the release do this change in the future releases?

file: check_fix.py
function: check_and_update_file_sizes
original line:
db_size = db.sizeof_format(book_id, fmt, index_is_id=True)
replace by:
db_size = next(db.backend.execute( "SELECT uncompressed_size FROM data WHERE book=? AND format=?", ( book_id, fmt ) ))[0]
I am not going to add direct sql access to calibre's tables.

What I will do is talk with Kovid about me adding API to base calibre to get that number. If he agrees then after the API change is released I will change the plugin appropriately.

Also note that your change isn't sufficient. The plugin calls
Code:
db.format_metadata(book_id, fmt, update_db=True, commit=True)
Note that it doesn't use the named parameter use_cache, which by default is true. Use_cache overrides update_db so the database is not updated. I will fix that as well if we get that far.
chaley is offline   Reply With Quote