mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-08 10:44:09 -04:00
Two robustness changes for formatting custom series indices
This commit is contained in:
parent
780bd84d29
commit
b40e5bba6e
@ -461,7 +461,7 @@ class Metadata(object):
|
|||||||
v = self.series_index if val is None else val
|
v = self.series_index if val is None else val
|
||||||
try:
|
try:
|
||||||
x = float(v)
|
x = float(v)
|
||||||
except ValueError:
|
except ValueError, TypeError:
|
||||||
x = 1
|
x = 1
|
||||||
return fmt_sidx(x)
|
return fmt_sidx(x)
|
||||||
|
|
||||||
@ -516,6 +516,7 @@ class Metadata(object):
|
|||||||
if datatype == 'text' and cmeta['is_multiple']:
|
if datatype == 'text' and cmeta['is_multiple']:
|
||||||
res = u', '.join(res)
|
res = u', '.join(res)
|
||||||
elif datatype == 'series' and series_with_index:
|
elif datatype == 'series' and series_with_index:
|
||||||
|
if self.get_extra(key):
|
||||||
res = res + \
|
res = res + \
|
||||||
' [%s]'%self.format_series_index(val=self.get_extra(key))
|
' [%s]'%self.format_series_index(val=self.get_extra(key))
|
||||||
elif datatype == 'datetime':
|
elif datatype == 'datetime':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user