diff --git a/src/calibre/library/server/browse.py b/src/calibre/library/server/browse.py index 5b7d732820..6de6fad726 100644 --- a/src/calibre/library/server/browse.py +++ b/src/calibre/library/server/browse.py @@ -669,10 +669,15 @@ class BrowseServer(object): args = {'id':id_, 'mi':mi, } ccache = self.categories_cache() if add_category_links else {} + ftitle = fauthors = '' for key in mi.all_field_keys(): val = mi.format_field(key)[1] if not val: val = '' + if key == 'title': + ftitle = xml(val, True) + elif key == 'authors': + fauthors = xml(val, True) if add_category_links: added_key = False fm = mi.metadata_for_field(key) @@ -710,8 +715,8 @@ class BrowseServer(object): args[key] = xml(val, True) else: args[key] = xml(val, True) - fname = quote(ascii_filename(args['title']) + ' - ' + - ascii_filename(args['authors'])) + fname = quote(ascii_filename(ftitle) + ' - ' + + ascii_filename(fauthors)) return args, fmt, fmts, fname @Endpoint(mimetype='application/json; charset=utf-8')