diff --git a/src/calibre/srv/code.py b/src/calibre/srv/code.py index 5fd2cb2836..2539f7e8cd 100644 --- a/src/calibre/srv/code.py +++ b/src/calibre/srv/code.py @@ -13,7 +13,7 @@ from calibre import prepare_string_for_xml, as_unicode from calibre.db.view import sanitize_sort_field_name from calibre.srv.ajax import get_db, search_result from calibre.srv.errors import HTTPNotFound, HTTPBadRequest -from calibre.srv.metadata import book_as_json, categories_as_json +from calibre.srv.metadata import book_as_json, categories_as_json, icon_map from calibre.srv.routes import endpoint, json from calibre.utils.icu import sort_key from calibre.utils.search_query_parser import ParseException @@ -120,6 +120,7 @@ def interface_data(ctx, rd): sanitize_sort_field_name(db.field_metadata, k), v) for k, v in sf.iteritems()), key=lambda (field, name):sort_key(name)) ans['field_metadata'] = db.field_metadata.all_metadata() + ans['icon_map'] = icon_map() mdata = ans['metadata'] = {} for book_id in ans['search_result']['book_ids']: data = book_as_json(db, book_id) diff --git a/src/calibre/srv/metadata.py b/src/calibre/srv/metadata.py index 6645494239..7bb88a7c66 100644 --- a/src/calibre/srv/metadata.py +++ b/src/calibre/srv/metadata.py @@ -493,7 +493,7 @@ def render_categories(field_metadata, opts, category_data): # We have to remove hidden categories after all processing is done as # items from a hidden category could be in a user category root['children'] = filter((lambda child:items[child['id']]['category'] not in opts.hidden_categories), root['children']) - return {'root':root, 'item_map': items, 'icon_map':icon_map()} + return {'root':root, 'item_map': items} def categories_as_json(ctx, rd, db): opts = categories_settings(rd.query, db)