mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
End point to get only tag browser data
This commit is contained in:
parent
ced4126d04
commit
a18dc59b27
@ -120,7 +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['categories'] = categories_as_json(ctx, rd, db)
|
||||
ans['tag_browser'] = categories_as_json(ctx, rd, db)
|
||||
mdata = ans['metadata'] = {}
|
||||
for book_id in ans['search_result']['book_ids']:
|
||||
data = book_as_json(db, book_id)
|
||||
@ -201,3 +201,13 @@ def get_books(ctx, rd):
|
||||
data = book_as_json(db, book_id)
|
||||
mdata[book_id] = data
|
||||
return ans
|
||||
|
||||
@endpoint('/interface-data/tag-browser', postprocess=json)
|
||||
def tag_browser(ctx, rd):
|
||||
'''
|
||||
Get the Tag Browser serialized as JSON
|
||||
Optional: ?library_id=<default library>&sort_tags_by=name&partition_method=first letter
|
||||
&collapse_at=25&dont_collapse=
|
||||
'''
|
||||
db, library_id = get_library_data(ctx, rd.query)[:2]
|
||||
return categories_as_json(ctx, rd, db)
|
||||
|
Loading…
x
Reference in New Issue
Block a user