mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 18:24:30 -04:00
Fix the Show more books button not respecting the current virtual library
This commit is contained in:
parent
3c65145eaa
commit
22d77263f8
@ -228,9 +228,9 @@ def more_books(ctx, rd):
|
|||||||
raise HTTPNotFound('Invalid number of books: %r' % rd.query.get('num'))
|
raise HTTPNotFound('Invalid number of books: %r' % rd.query.get('num'))
|
||||||
try:
|
try:
|
||||||
search_query = load_json_file(rd.request_body_file)
|
search_query = load_json_file(rd.request_body_file)
|
||||||
query, offset, sorts, orders = search_query['query'], search_query[
|
query, offset, sorts, orders, vl = search_query['query'], search_query[
|
||||||
'offset'
|
'offset'
|
||||||
], search_query['sort'], search_query['sort_order']
|
], search_query['sort'], search_query['sort_order'], search_query['vl']
|
||||||
except KeyError as err:
|
except KeyError as err:
|
||||||
raise HTTPBadRequest('Search query missing key: %s' % as_unicode(err))
|
raise HTTPBadRequest('Search query missing key: %s' % as_unicode(err))
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
@ -238,7 +238,7 @@ def more_books(ctx, rd):
|
|||||||
ans = {}
|
ans = {}
|
||||||
with db.safe_read_lock:
|
with db.safe_read_lock:
|
||||||
ans['search_result'] = search_result(
|
ans['search_result'] = search_result(
|
||||||
ctx, rd, db, query, num, offset, sorts, orders
|
ctx, rd, db, query, num, offset, sorts, orders, vl
|
||||||
)
|
)
|
||||||
mdata = ans['metadata'] = {}
|
mdata = ans['metadata'] = {}
|
||||||
for book_id in ans['search_result']['book_ids']:
|
for book_id in ans['search_result']['book_ids']:
|
||||||
|
@ -185,7 +185,7 @@ def got_more_books(end_type, xhr, event):
|
|||||||
|
|
||||||
def get_more_books():
|
def get_more_books():
|
||||||
data = {'offset':book_list_data.shown_book_ids.length}
|
data = {'offset':book_list_data.shown_book_ids.length}
|
||||||
for key in 'query', 'sort', 'sort_order':
|
for key in 'query', 'sort', 'sort_order', 'vl':
|
||||||
data[key] = library_data.search_result[key]
|
data[key] = library_data.search_result[key]
|
||||||
book_list_data.fetching_more_books = ajax_send(
|
book_list_data.fetching_more_books = ajax_send(
|
||||||
'interface-data/more-books', data, got_more_books,
|
'interface-data/more-books', data, got_more_books,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user