|
|
#1 |
|
Zealot
![]() ![]() Posts: 146
Karma: 100
Join Date: Aug 2003
Location: Nigeria
Device: galaxy tab
|
size column
Greetings,
It appears that the size column does not total all the formats of a particular entry. How can I accomplish this? |
|
|
|
|
|
#2 | |
|
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31,272
Karma: 61916422
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
The QC plugin can recalculate the size column values (if you have modified that format after importing/or conversion). IMHO Total is only useful for Libraries. I send a specific, single format, to my device. Not all formats (which it does poorly with many of those).
|
|
|
|
|
| Advert | |
|
|
|
|
#3 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,525
Karma: 8065948
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
You can get a list of the formats with their sizes using a composite custom column (column built from other columns) with the template {:'formats_sizes()'}
You can get the sum of the sizes in one of two ways.
|
|
|
|
|
|
#4 |
|
Zealot
![]() ![]() Posts: 146
Karma: 100
Join Date: Aug 2003
Location: Nigeria
Device: galaxy tab
|
Thanks guys
|
|
|
|
|
|
#5 |
|
Zealot
![]() ![]() Posts: 146
Karma: 100
Join Date: Aug 2003
Location: Nigeria
Device: galaxy tab
|
chaley your snippet worked perfect for me. Is it possible to format the {:'formats_sizes()'} function with human readable? I tried {:'human_readable(formats_sizes())'} but it returned an error.
|
|
|
|
| Advert | |
|
|
|
|
#6 | |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,525
Karma: 8065948
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
You can, of course, do this in a user-defined formatter function. It would look something like Code:
Function name: mySizes
Arg count: 1
Program code:
def evaluate(self, formatter, kwargs, mi, locals, x):
from calibre import human_readable
r = []
if x.strip():
for p in x.split(','):
v = p.split(':')
r.append(v[0] + ': ' + human_readable(long(v[1])))
return ', '.join(r)
Code:
{:'mySizes(formats_sizes())'}
|
|
|
|
|
|
|
#7 |
|
Zealot
![]() ![]() Posts: 146
Karma: 100
Join Date: Aug 2003
Location: Nigeria
Device: galaxy tab
|
cool, thanks
|
|
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Can't get {size} data in a User Column? | CCarrot | Calibre | 16 | 06-26-2012 12:39 PM |
| Q: multi-column PDF to single column mobi format converstion | auburn1975 | Calibre | 7 | 01-28-2012 07:11 PM |
| Cover Size Column? | transmitthis | Library Management | 5 | 06-19-2011 07:27 AM |
| Refresh size column | Perkin | Calibre | 5 | 09-10-2010 12:31 PM |
| Purpose of Size column? | itimpi | Calibre | 6 | 06-16-2009 09:44 PM |