Fix the Show more books button not respecting the current virtual library

This commit is contained in:
Kovid Goyal 2017-05-18 17:29:07 +05:30
parent 3c65145eaa
commit 22d77263f8
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 4 additions and 4 deletions

View File

@ -228,9 +228,9 @@ def more_books(ctx, rd):
raise HTTPNotFound('Invalid number of books: %r' % rd.query.get('num'))
try:
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'
], search_query['sort'], search_query['sort_order']
], search_query['sort'], search_query['sort_order'], search_query['vl']
except KeyError as err:
raise HTTPBadRequest('Search query missing key: %s' % as_unicode(err))
except Exception as err:
@ -238,7 +238,7 @@ def more_books(ctx, rd):
ans = {}
with db.safe_read_lock:
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'] = {}
for book_id in ans['search_result']['book_ids']:

View File

@ -185,7 +185,7 @@ def got_more_books(end_type, xhr, event):
def get_more_books():
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]
book_list_data.fetching_more_books = ajax_send(
'interface-data/more-books', data, got_more_books,