mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-01-30 10:24:56 +01:00
commit
e7c29dfa7d
2 changed files with 2 additions and 4 deletions
|
|
@ -94,11 +94,9 @@ def __call__(self, id_, key, fmts, cache_index, db, icon_cache, icon_bitmap_cach
|
|||
if not rule_icons:
|
||||
continue
|
||||
icon_list = [ic.strip() for ic in rule_icons.split(':')]
|
||||
icons.extend(icon_list)
|
||||
if icon_list and not kind.endswith('_composed'):
|
||||
icons = icon_list
|
||||
break
|
||||
else:
|
||||
icons.extend(icon_list)
|
||||
|
||||
if icons:
|
||||
icon_string = ':'.join(icons)
|
||||
|
|
|
|||
|
|
@ -589,7 +589,7 @@ class BuiltinCount(BuiltinFormatterFunction):
|
|||
'uses an ampersand. Examples: {tags:count(,)}, {authors:count(&)}')
|
||||
|
||||
def evaluate(self, formatter, kwargs, mi, locals, val, sep):
|
||||
return unicode(len(val.split(sep)))
|
||||
return unicode(len([v for v in val.split(sep) if v]))
|
||||
|
||||
class BuiltinListitem(BuiltinFormatterFunction):
|
||||
name = 'list_item'
|
||||
|
|
|
|||
Loading…
Reference in a new issue