Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 09-30-2015, 01:18 AM   #1
eucalyptus
Junior Member
eucalyptus began at the beginning.
 
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?
eucalyptus is offline   Reply With Quote
Old 09-30-2015, 01:20 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
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.
kovidgoyal is offline   Reply With Quote
Old 09-30-2015, 07:41 AM   #3
eucalyptus
Junior Member
eucalyptus began at the beginning.
 
Posts: 8
Karma: 10
Join Date: Nov 2010
Device: PRS-300
I see, thank you, will check out that plugin!
eucalyptus is offline   Reply With Quote
Old 11-11-2017, 10:58 AM   #4
gingerbeardman
Zealot
gingerbeardman ought to be getting tired of karma fortunes by now.gingerbeardman ought to be getting tired of karma fortunes by now.gingerbeardman ought to be getting tired of karma fortunes by now.gingerbeardman ought to be getting tired of karma fortunes by now.gingerbeardman ought to be getting tired of karma fortunes by now.gingerbeardman ought to be getting tired of karma fortunes by now.gingerbeardman ought to be getting tired of karma fortunes by now.gingerbeardman ought to be getting tired of karma fortunes by now.gingerbeardman ought to be getting tired of karma fortunes by now.gingerbeardman ought to be getting tired of karma fortunes by now.gingerbeardman ought to be getting tired of karma fortunes by now.
 
gingerbeardman's Avatar
 
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.
gingerbeardman is offline   Reply With Quote
Old 11-11-2017, 02:02 PM   #5
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
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:
Originally Posted by gingerbeardman View Post
Did you solve this? I have this issue also.
That was an ancient post. The answer Kovid gave is still relevant. QC PI
FWIW the size also updates after a Tweak-book (Calibre Editor)
theducks is offline   Reply With Quote
Old 11-11-2017, 02:46 PM   #6
gingerbeardman
Zealot
gingerbeardman ought to be getting tired of karma fortunes by now.gingerbeardman ought to be getting tired of karma fortunes by now.gingerbeardman ought to be getting tired of karma fortunes by now.gingerbeardman ought to be getting tired of karma fortunes by now.gingerbeardman ought to be getting tired of karma fortunes by now.gingerbeardman ought to be getting tired of karma fortunes by now.gingerbeardman ought to be getting tired of karma fortunes by now.gingerbeardman ought to be getting tired of karma fortunes by now.gingerbeardman ought to be getting tired of karma fortunes by now.gingerbeardman ought to be getting tired of karma fortunes by now.gingerbeardman ought to be getting tired of karma fortunes by now.
 
gingerbeardman's Avatar
 
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.
gingerbeardman is offline   Reply With Quote
Old 11-11-2017, 03:37 PM   #7
gingerbeardman
Zealot
gingerbeardman ought to be getting tired of karma fortunes by now.gingerbeardman ought to be getting tired of karma fortunes by now.gingerbeardman ought to be getting tired of karma fortunes by now.gingerbeardman ought to be getting tired of karma fortunes by now.gingerbeardman ought to be getting tired of karma fortunes by now.gingerbeardman ought to be getting tired of karma fortunes by now.gingerbeardman ought to be getting tired of karma fortunes by now.gingerbeardman ought to be getting tired of karma fortunes by now.gingerbeardman ought to be getting tired of karma fortunes by now.gingerbeardman ought to be getting tired of karma fortunes by now.gingerbeardman ought to be getting tired of karma fortunes by now.
 
gingerbeardman's Avatar
 
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
gingerbeardman is offline   Reply With Quote
Old 11-11-2017, 04:53 PM   #8
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
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:
Originally Posted by gingerbeardman View Post
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.
T is the shortcut for the editor, U is the Old Tweak Books (unpack)

Neither work on PDF. (which was not mentioned in post 1)
theducks is offline   Reply With Quote
Old 11-11-2017, 10:53 PM   #9
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
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.
kovidgoyal is offline   Reply With Quote
Old 11-12-2017, 05:09 AM   #10
gingerbeardman
Zealot
gingerbeardman ought to be getting tired of karma fortunes by now.gingerbeardman ought to be getting tired of karma fortunes by now.gingerbeardman ought to be getting tired of karma fortunes by now.gingerbeardman ought to be getting tired of karma fortunes by now.gingerbeardman ought to be getting tired of karma fortunes by now.gingerbeardman ought to be getting tired of karma fortunes by now.gingerbeardman ought to be getting tired of karma fortunes by now.gingerbeardman ought to be getting tired of karma fortunes by now.gingerbeardman ought to be getting tired of karma fortunes by now.gingerbeardman ought to be getting tired of karma fortunes by now.gingerbeardman ought to be getting tired of karma fortunes by now.
 
gingerbeardman's Avatar
 
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
gingerbeardman is offline   Reply With Quote
Old 07-14-2020, 02:10 PM   #11
jindroush
Connoisseur
jindroush is on a distinguished road
 
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.
jindroush is offline   Reply With Quote
Old 07-14-2020, 05:36 PM   #12
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,570
Karma: 26954694
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by jindroush View Post
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:
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
BetterRed is online now   Reply With Quote
Old 07-15-2020, 04:38 AM   #13
jindroush
Connoisseur
jindroush is on a distinguished road
 
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.
jindroush is offline   Reply With Quote
Old 07-15-2020, 04:46 AM   #14
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
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.
kovidgoyal is offline   Reply With Quote
Old 07-15-2020, 05:38 AM   #15
jindroush
Connoisseur
jindroush is on a distinguished road
 
Posts: 78
Karma: 52
Join Date: Nov 2014
Device: Kindle
Quote:
Originally Posted by kovidgoyal View Post
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.
Yes, this is what I found out. But the logic in QualityCheck is basically based on assumption that there is a difference between 'uncompressed_size' and actual filesystem size and this is what it checks and tries to repair, and that there is a method of getting 'uncompressed_size'. It seems that this logic is based on the past behaviour of Calibre, and since the plugin seems to be abandoned, it's not working anymore.

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).
jindroush is offline   Reply With Quote
Reply

Tags
calibre, refresh, size, sort


Forum Jump

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


All times are GMT -4. The time now is 12:12 AM.


MobileRead.com is a privately owned, operated and funded community.