Save to disk/send to device templates: Always render {series_index} as an empty string when the book has no series. Fixes #6409 (Make series_index empty string if series empty string)

This commit is contained in:
Kovid Goyal 2010-08-05 11:23:54 -06:00
parent 3c266410be
commit 88e962ae39

View File

@ -125,6 +125,8 @@ def get_components(template, mi, id, timefmt='%b %Y', length=250,
format_args['series'] = mi.series
if mi.series_index is not None:
format_args['series_index'] = mi.format_series_index()
else:
template = re.sub(r'\{series_index[^}]*?\}', '', template)
if mi.rating is not None:
format_args['rating'] = mi.format_rating()
if mi.isbn: