Relates to #2194
This is unrelated to these changes, but if eligibility API given bad isbn, fails ungracefully:
https://dev.openlibrary.org/sponsorship/eligibility/97802992042042?debug=true
<type 'exceptions.AttributeError'> at /sponsorship/eligibility/97802992042042
'NoneType' object has no attribute 'get_isbn13'
/opt/openlibrary/deploys/openlibrary/openlibrary/openlibrary/core/sponsorships.py in qualifies_for_sponsorship
edition.isbn = edition.get_isbn13()
/opt/openlibrary/deploys/openlibrary/openlibrary/openlibrary/plugins/openlibrary/api.py in GET
return simplejson.dumps(qualifies_for_sponsorship(edition))
https://dev.openlibrary.org/sponsorship/eligibility/97802992042042?debug=true
Should check if edition and gracefully error accordingly.
I would like to work on this.
Hey! Sorry for the delay, @sbvkrishna ; October was a little busy. Go for it! Let us know if you have any questions.
Also fails on the following ISBN13 if this helps:
9781682827352
9780367186715
9780520284777
9781526137029
9781138271869
@brierjon Of those five, the first four are dated 2020, so perhaps not yet in press?
The last has equivalent isbn10:1138271861 which (when searching on just the number) gets additionally matched to http://d-nb.info/1138271861 -- not sure if that's relevant or not
@LeadSongDog True with future copyright dates for the first four. I don't think they're in print yet or just preview copies, but 9781682827352 is listed on both amazon.com and betterworld books so it theoretically should be available for import and shouldn't throw this error or should specify that it fails due to a future publication/copyright date.
Where are you see the additional match for 9781138271869? It appears on amazon.com, but not listed on Better World Books. Should match to https://www.routledge.com/Community-Competition-and-Citizen-Science-Voluntary-Distributed-Computing/Holohan/p/book/9781138271869 and this is a 2016 publication according to Routledge. The book also fails on 9781409452980 the hardcover version of the book which is listed on both amazon.com and Better World Books but that is with the error in #2657. 9781138271869 was experiencing this issue's bug, but now shows the same error as #2657. Weird.
@brierjon Sorry I was not clear. The extra match was found via https://www.worldcat.org/search?qt=worldcat_org_all&q=1138271861
Of course the isbn-specific query https://www.worldcat.org/search?q=Isbn%3A1138271861&qt=results_page only finds one match, but I鈥檓 not sure what the API looks for.
I'll try having a look at this once I've set up my environment.
@tabshaikh can you help @nsudarsanam or @sbvkrishna with this one? It may be a bit tricky because it relies on e.g. the amazon API (which the local env. doesn't have)
@nsudarsanam or @sbvkrishna do you need help setting up your environments?
Hi @mekarpeles I started haven't gotten through with it. I'll have some more time later this week!
Hi @tabshaikh i've gotten everything setup and can navigate the site on localhost. But for the life of me, I can't seem to figure out what the dev api endpoint is to get my breakpoints to get hit. Is the dev api also hosted at localhost:8080 (assuming I'm seeing the website on that)?
Great work setting up the local environment but as @mekarpeles pointed out it is a bit tricky as the local environment does not have the API for which you can test it
Noticed you have a PR up for this issue, I wish I had known that before I set things up :). Is there another issue I can work on instead?
@nsudarsanam No worries it's great you have set up the local environment can you tell me which issues like frontend, the backend would you be interested in solving so that I could tag you in those issues :)
Thanks @tabshaikh, I'd prefer backend issues over frontend. I have sometime this week and next so if you find anything that seems worth taking a look at, please send them along my way!
@mekarpeles @tabshaikh
Great work, but the fail is not as graceful as could be useful.
Stating a valid ISBN number like 1138271861 for https://www.amazon.com/Community-Competition-Citizen-Science-Distributed/dp/1138271861/ and others listed above as not valid is misleading. The response for these would be more useful to state the book is not eligible for sponsorship and include the criteria check that failed in the response. Providing the criteria check that failed in the response this would allow an action to be taken to correct the criteria where possible ie the ISBN is not found to be available at X or Y sources which is used as eligibility criteria could spark demand for the listing on those services or encourage integrating a new source which does have the ISBN available on lookup.
Only in the case that an ISBN number does not follow the format of ISBN 10 or 13 or another technical reason to fail should the error state the "ISNB is not valid" ie format is less than 10 numbers etc.
Related, but not dealing with the error: ineligible ISBN values in the correct format could be logged when failing the sponsorship check to track what books are of interest and what criteria is the most frequent reason to prioritize the work specific fields, genres, etc. Also the items not found at the current sources as it could indicate a gap in types of books or publishers and tracking just the ISBN and failing criteria should respect the privacy of the requester yet provide useful metrics.