This issue will need to be done by staff, and builds on work done in #8511.
We need /api/books and /isbn to similarly request data from ISBNdb metadata or AMZ if necessary.
Describe the problem that you'd like solved
Currently, requests hit /api/books (see openlibrary/plugins/books/code.py) for IA digitization metadata, using ISBN, LCCN, etc.
If the book is not in Open Library, and we're given an ISBN via this endpoint, we want /api/books to factor out a shared and DRYed code path with /isbn, such that both /isbn and /api/books will fetch matching ISBNdb records, or, if no ISBNdb metadata is found for that ISBN, then the code will hit + block on the AMZ affiliate server to get metadata based on ISBN.
In either case, whether the metadata is returned from the ISBNdb metadata or AMZ, returned data should be imported by load(), and then /isbn should redirect to the book or return the book JSON, and /api/books should retry the request after the edition exists so we can get the book's metadata in the proper /api/books JSON output format.
Additional context
Note: this will require finishing work started in #8511, which involve moving retries from /isbn to the affiliate server.
This issue will need to be done by staff, and builds on work done in #8511.
We need
/api/books
and/isbn
to similarly request data from ISBNdb metadata or AMZ if necessary.Describe the problem that you'd like solved
Currently, requests hit
/api/books
(seeopenlibrary/plugins/books/code.py
) for IA digitization metadata, using ISBN, LCCN, etc.If the book is not in Open Library, and we're given an ISBN via this endpoint, we want
/api/books
to factor out a shared and DRYed code path with/isbn
, such that both/isbn
and/api/books
will fetch matching ISBNdb records, or, if no ISBNdb metadata is found for that ISBN, then the code will hit + block on the AMZ affiliate server to get metadata based on ISBN.In either case, whether the metadata is returned from the ISBNdb metadata or AMZ, returned data should be imported by
load()
, and then/isbn
should redirect to the book or return the book JSON, and/api/books
should retry the request after the edition exists so we can get the book's metadata in the proper/api/books
JSON output format.Additional context
Note: this will require finishing work started in #8511, which involve moving retries from
/isbn
to the affiliate server.Stakeholders
@mekarpeles