mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 20:03:43 +02:00
Make approximate_formats work when there are no formats
This commit is contained in:
parent
9b3899266c
commit
7571cbf7ac
1 changed files with 2 additions and 0 deletions
|
|
@ -608,6 +608,8 @@ class BuiltinApproximateFormats(BuiltinFormatterFunction):
|
|||
|
||||
def evaluate(self, formatter, kwargs, mi, locals):
|
||||
fmt_data = mi.get('db_approx_formats', [])
|
||||
if not fmt_data:
|
||||
return ''
|
||||
data = sorted(fmt_data)
|
||||
return ','.join(v.upper() for v in data)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue