-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixing search to rm flickering, availability check moved to backend #995
Conversation
$ waiting_loan = ctx.user and ctx.user.get_waiting_loan_for(page) | ||
$ user_loan = None | ||
$ my_turn_to_borrow = waiting_loan and waiting_loan['status'] == 'available' and waiting_loan['position'] == 1 | ||
$ wlsize = availability.get('num_waitlist', 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
QUESTION: Same question as in the other PR. Is it misleading to say a failed waitlist number get
should be treated as an empty waitlist?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One problem is that it's inconsistent how its represented on IA's side. In most cases where there hasn't been a waitlist before, I believe the availability API reports None
for the waitlist whereas if there was a waitlist and it has been decremented, the value shows as 0.
This being the case, I think the right answer is to keep the default as 0. This value is only used if there is a waitlist for the book. And if the waitlist value is somehow fundamentally wrong, that's a data problem.
data-userid="$(user_loan['userid'])" id="read_ebook" | ||
class="borrow-btn borrow-link">Read eBook</a> | ||
|
||
$ return_url = page.url.rsplit('/', 1)[0] + '/do_return/borrow' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
QUESTION: How fragile is this text parsing, i.e. when using different kinds of base URLS, e.g. with subdomains, localhost, with/without protocol, etc.?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. Investigating.
Closes #733
Description:
TL;DR: Fixing search to rm flickering, availability check moved to backend
When
ebooks
mode was selected, we used to rely on availability.js to filter out all books which didn't have ebooks. This is because our openlibrary solr things anything with an ocaid (i.e. archive.org ID) is an ebook, whereas many of these are printdisabled and can't be ready by the user. This availability check process was incorporated into the backend over our search results to prevent the interface from visually pruning records.Also, fixes search results so they correctly show the user's waitlist + loan status on relevant titles.