mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Make approximate_formats work when there are no formats
This commit is contained in:
parent
9b3899266c
commit
7571cbf7ac
@ -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…
x
Reference in New Issue
Block a user