09-30-2015, 01:18 AM | #1 |
Junior Member
Posts: 8
Karma: 10
Join Date: Nov 2010
Device: PRS-300
|
Calibre Sort by Size Not Refreshing
Hello! I was wondering if anyone would know how to fix this:
I noticed the other day that some of my ebooks were humongous in size, so I added a 'size' column in Calibre and sorted them by size. Then I started individually opening each folder and trimming the ebooks down in size (removing custom fonts and jpegs from epubs, etc.). I noticed, though, that even though I restarted Calibre and the computer, Calibre still displays the old size of the files in the 'size' sorting column. It still says, for instance, 82 mb for a file that is now only 2 mb. How do I make Calibre show the actual, updated file size for each ebook? |
09-30-2015, 01:20 AM | #2 |
creator of calibre
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
The size column in calibre is only updated when you add/remove a book format. IIRC the quality check plugin has an option to scan the library and update that info.
|
09-30-2015, 07:41 AM | #3 |
Junior Member
Posts: 8
Karma: 10
Join Date: Nov 2010
Device: PRS-300
|
I see, thank you, will check out that plugin!
|
11-11-2017, 10:58 AM | #4 |
Zealot
Posts: 129
Karma: 1001024
Join Date: Apr 2010
Location: Cornwall, UK
Device: Various Sony Readers, Kobo Touch Edition, iPhone
|
Did you solve this? I have this issue also.
|
11-11-2017, 02:02 PM | #5 |
Well trained by Cats
Posts: 29,803
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
|
11-11-2017, 02:46 PM | #6 |
Zealot
Posts: 129
Karma: 1001024
Join Date: Apr 2010
Location: Cornwall, UK
Device: Various Sony Readers, Kobo Touch Edition, iPhone
|
It was an ancient post without a confirmed resolution.
I'm working with PDFs rather than ePubs. https://www.mobileread.com/forums/sh...d.php?t=292065 Kovid's "add/remove a book format" does not seem to work for PDFs. I've tried QC PI and had no luck. Which option have you seen resolve this size issue? And I don't think Tweak Books is in the latest Calibre? Any help appreciated. Last edited by gingerbeardman; 11-11-2017 at 03:34 PM. |
11-11-2017, 03:37 PM | #7 |
Zealot
Posts: 129
Karma: 1001024
Join Date: Apr 2010
Location: Cornwall, UK
Device: Various Sony Readers, Kobo Touch Edition, iPhone
|
data is at:
metadata.db TABLE data COLUMN uncompressed_size |
11-11-2017, 04:53 PM | #8 | |
Well trained by Cats
Posts: 29,803
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
Neither work on PDF. (which was not mentioned in post 1) |
|
11-11-2017, 10:53 PM | #9 |
creator of calibre
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
The size calibre displays is a not a file size, it is the size of the largest of a book's files, and it is updated when you add/remove a format, regardless of what format the book is in.
|
11-12-2017, 05:09 AM | #10 |
Zealot
Posts: 129
Karma: 1001024
Join Date: Apr 2010
Location: Cornwall, UK
Device: Various Sony Readers, Kobo Touch Edition, iPhone
|
I ended up using "restore database" in the Calibre Library menu
thanks all |
07-14-2020, 02:10 PM | #11 |
Connoisseur
Posts: 78
Karma: 52
Join Date: Nov 2014
Device: Kindle
|
Refresh size
I KNOW that I'm reopening years old thread.
I have the same problem as OP, I modify files directly in Calibre library directory. Tried to use (most probably abandoned) QualityCheck plugin, it does not work on current Calibre, because it calls: formats = db.formats(book_id, index_is_id=True, verify_formats=False) for fmt in formats.split(','): db_size = db.sizeof_format(book_id, fmt, index_is_id=True) but that is implemented in legacy.py as filesystem read, instead of table read. So this check is always 'good', because it compares disk size to disk size and thus does not fix db. So question, directly to Kovid, if possible: With what call should be db.sizeof_format replaced with to get data from uncompressed_size column? Thx, J. |
07-14-2020, 05:36 PM | #12 | |
null operator (he/him)
Posts: 20,570
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Quote:
Moderator Notice
The QC PI will need to be updated to support Python 3 used the upcoming Calibre 5 release. One of the active PI developers will do that… I hope BR |
|
07-15-2020, 04:38 AM | #13 |
Connoisseur
Posts: 78
Karma: 52
Join Date: Nov 2014
Device: Kindle
|
Fix
So I replaced this line (in QualityCheck.zip/check_fix.py)
db_size = db.sizeof_format(book_id, fmt, index_is_id=True) with db_size = next(db.backend.execute( "SELECT uncompressed_size FROM data WHERE book=? AND format=?", ( book_id, fmt ) ))[0] which does what I need in QualityCheck/Fix/Check and repair file sizes. I wasn't able to do that using any LibraryDatabase or Cache call. |
07-15-2020, 04:46 AM | #14 |
creator of calibre
Posts: 43,858
Karma: 22666666
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
You use format_metadata() Note that uncompressed_size is not actually used for anything. Sizes of individual format files are read from the filesystem with a cache for performance.
|
07-15-2020, 05:38 AM | #15 | |
Connoisseur
Posts: 78
Karma: 52
Join Date: Nov 2014
Device: Kindle
|
Quote:
With the fix I made, uncompress_size and also the max of all formats are updated, which makes me happy (since I use sqlite db dump of metadata.db to do some other checks externally). |
|
Tags |
calibre, refresh, size, sort |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
PB626 - Problem refreshing library and syncing with Calibre | grouphile | PocketBook | 0 | 06-08-2015 04:38 AM |
Sort by Calibre Folder ID | JohnnyBook | Library Management | 4 | 10-24-2014 10:06 AM |
Calibre - sort by author last name | Switters | Calibre | 1 | 07-20-2013 05:39 PM |
Calibre 8.54 - Problem with Sort | mitch13 | Library Management | 3 | 06-15-2012 02:11 AM |
Refreshing Calibre? | Devon | Calibre | 7 | 11-19-2009 08:12 PM |