View Single Post
Old 01-02-2021, 08:10 AM   #1039
jindroush
Connoisseur
jindroush doesn't litterjindroush doesn't litter
 
Posts: 94
Karma: 104
Join Date: Nov 2014
Device: Kindle
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]

Without this change Calibre never consults db_size actually, as sizeof_format is touching disk, not db.

How to test the functionality:
a) Add any ebook to calibre
b) Manually modify the filesize on the disk in calibre's storage folder
c) Check by Quality Check/Fix/Check and repair book sizes - the original code does not find any difference, the fixed code finds one and fixes it.
jindroush is offline   Reply With Quote