From 5bd2d8d60423101e3ebcfde8b6d46c1aaa14921b Mon Sep 17 00:00:00 2001 From: Charles Haley <> Date: Tue, 13 Mar 2012 07:21:10 +0100 Subject: [PATCH] Fixes use of 'size' field in coloring. --- src/calibre/library/coloring.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/calibre/library/coloring.py b/src/calibre/library/coloring.py index e1955077b3..4847a48c7d 100644 --- a/src/calibre/library/coloring.py +++ b/src/calibre/library/coloring.py @@ -117,7 +117,10 @@ class Rule(object): # {{{ 'lt': ('1', '', ''), 'gt': ('', '', '1') }[action] - return "cmp(raw_field('%s'), %s, '%s', '%s', '%s')" % (col, val, lt, eq, gt) + if col == 'size': + return "cmp(booksize(), %s, '%s', '%s', '%s')" % (val, lt, eq, gt) + else: + return "cmp(raw_field('%s'), %s, '%s', '%s', '%s')" % (col, val, lt, eq, gt) def rating_condition(self, col, action, val): lt, eq, gt = {