mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
...
This commit is contained in:
parent
157f2c4211
commit
afd02fd413
@ -13,7 +13,7 @@ from calibre import prepare_string_for_xml, as_unicode
|
|||||||
from calibre.db.view import sanitize_sort_field_name
|
from calibre.db.view import sanitize_sort_field_name
|
||||||
from calibre.srv.ajax import get_db, search_result
|
from calibre.srv.ajax import get_db, search_result
|
||||||
from calibre.srv.errors import HTTPNotFound, HTTPBadRequest
|
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.srv.routes import endpoint, json
|
||||||
from calibre.utils.icu import sort_key
|
from calibre.utils.icu import sort_key
|
||||||
from calibre.utils.search_query_parser import ParseException
|
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()),
|
sanitize_sort_field_name(db.field_metadata, k), v) for k, v in sf.iteritems()),
|
||||||
key=lambda (field, name):sort_key(name))
|
key=lambda (field, name):sort_key(name))
|
||||||
ans['field_metadata'] = db.field_metadata.all_metadata()
|
ans['field_metadata'] = db.field_metadata.all_metadata()
|
||||||
|
ans['icon_map'] = icon_map()
|
||||||
mdata = ans['metadata'] = {}
|
mdata = ans['metadata'] = {}
|
||||||
for book_id in ans['search_result']['book_ids']:
|
for book_id in ans['search_result']['book_ids']:
|
||||||
data = book_as_json(db, book_id)
|
data = book_as_json(db, book_id)
|
||||||
|
@ -493,7 +493,7 @@ def render_categories(field_metadata, opts, category_data):
|
|||||||
# We have to remove hidden categories after all processing is done as
|
# We have to remove hidden categories after all processing is done as
|
||||||
# items from a hidden category could be in a user category
|
# 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'])
|
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):
|
def categories_as_json(ctx, rd, db):
|
||||||
opts = categories_settings(rd.query, db)
|
opts = categories_settings(rd.query, db)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user