mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Endpoint to conveniently get info about available libraries
This commit is contained in:
parent
fb778e5a2d
commit
376b166b1a
@ -552,6 +552,14 @@ def search(ctx, rd, library_id):
|
|||||||
num, offset = get_pagination(rd.query)
|
num, offset = get_pagination(rd.query)
|
||||||
with db.safe_read_lock:
|
with db.safe_read_lock:
|
||||||
return search_result(ctx, rd, db, query, num, offset, rd.query.get('sort', 'title'), rd.query.get('sort_order', 'asc'))
|
return search_result(ctx, rd, db, query, num, offset, rd.query.get('sort', 'title'), rd.query.get('sort_order', 'asc'))
|
||||||
|
|
||||||
|
|
||||||
|
@endpoint('/ajax/library-info', postprocess=json)
|
||||||
|
def library_info(ctx, rd):
|
||||||
|
' Return info about available libraries '
|
||||||
|
library_map, default_library = ctx.library_map
|
||||||
|
return {'library_map':library_map, 'default_library':default_library}
|
||||||
|
|
||||||
# }}}
|
# }}}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user