mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-01-16 19:15:17 +01:00
Restore getting the size value to old behavior
This commit is contained in:
parent
fb45095153
commit
4ffb8e2202
2 changed files with 2 additions and 2 deletions
|
|
@ -113,7 +113,7 @@ def read(self, db):
|
|||
for row in db.conn.execute(
|
||||
'SELECT books.id, (SELECT MAX(uncompressed_size) FROM data '
|
||||
'WHERE data.book=books.id) FROM books'):
|
||||
self.book_col_map[row[0]] = self.unserialize(row[1] or 0)
|
||||
self.book_col_map[row[0]] = self.unserialize(row[1])
|
||||
|
||||
def update_sizes(self, size_map):
|
||||
self.book_col_map.update(size_map)
|
||||
|
|
|
|||
|
|
@ -660,7 +660,7 @@ def func(idx):
|
|||
elif field == 'size':
|
||||
sz_mult = 1.0/(1024**2)
|
||||
def func(idx):
|
||||
val = fffunc(field_obj, idfunc(idx), default_value=0)
|
||||
val = fffunc(field_obj, idfunc(idx), default_value=0) or 0
|
||||
ans = u'%.1f' % (val * sz_mult)
|
||||
if val > 0 and ans == u'0.0':
|
||||
ans = u'<0.1'
|
||||
|
|
|
|||
Loading…
Reference in a new issue