internetarchive / openlibrary

One webpage for every book ever published!
https://openlibrary.org
GNU Affero General Public License v3.0
5.19k stars 1.35k forks source link

ISBN Endpoint Not Redirecting to book with ISBN #8120

Open RayBB opened 1 year ago

RayBB commented 1 year ago

Evidence / Screenshot (if possible)

Relevant url?

https://openlibrary.org/isbn/9783906484754

This book has that ISBN: https://openlibrary.org/books/OL32964770M/

Steps to Reproduce

  1. Go to above url

Details

This is annoying because I often use the ISBN url to quickly get to books by copying isbn and pasting it into the isbn url.

Proposal & Constraints

Related files

Stakeholders

mekarpeles commented 1 year ago

Seems to work in some cases -- https://openlibrary.org/isbn/0064410935

Is it 978 ISBNs?

RayBB commented 1 year ago

I use this endpoint many times per day and 978 ISBNs work fine like https://openlibrary.org/isbn/9782709642521

sbwhitt commented 1 year ago

@mekarpeles @RayBB Tried looking into this. I noticed, at least for the example work provided (https://openlibrary.org/books/OL32964770M/), that the only ISBN listed is an ISBN 10 but the actual value is 9783906484754.

image

The search ultimately fails because the ISBN passed to the URL is determined to be an ISBN 13 due to it's length, then converted to an ISBN 10. The search is then carried out using that converted ISBN 10 value, but because that ISBN 10 is different from the bad ISBN 10 on this work (since it's actually 13 digits) the search returns a 404.

I've ran the ISBN listed through the same check digit code in the ISBN search code and it is a valid ISBN 13. Seems like a case of bad data entry, at least for that particular work. Now wondering how that work was able to be saved as having a 13 digit ISBN 10. For this work, could probably be fixed by simply updating the ISBN 10 to an ISBN 13, but I didn't do that just yet in case anyone wanted to look into why this happened first. I assume this happened due to some data import error since you can't save an ISBN 10 as having 13 digits manually.

scottbarnes commented 1 year ago

Good catch, @sbwhitt.