-
-
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
Move AMZ retry code from Edition.from_isbn()
to affiliate-server
#8541
Labels
Lead: @mekarpeles
Issues overseen by Mek (Staff: Program Lead) [managed]
Module: Import
Issues related to the configuration or use of importbot and other bulk import systems. [managed]
Priority: 2
Important, as time permits. [managed]
Type: Feature Request
Issue describes a feature or enhancement we'd like to implement. [managed]
Comments
scottbarnes
added
Type: Feature Request
Issue describes a feature or enhancement we'd like to implement. [managed]
Module: Import
Issues related to the configuration or use of importbot and other bulk import systems. [managed]
Lead: @mekarpeles
Issues overseen by Mek (Staff: Program Lead) [managed]
labels
Nov 18, 2023
scottbarnes
added
Needs: Triage
This issue needs triage. The team needs to decide who should own it, what to do, by when. [managed]
Needs: Lead
and removed
Lead: @mekarpeles
Issues overseen by Mek (Staff: Program Lead) [managed]
labels
Nov 18, 2023
jimchamp
added
Priority: 2
Important, as time permits. [managed]
Lead: @mekarpeles
Issues overseen by Mek (Staff: Program Lead) [managed]
Lead: @scottbarnes
Issues overseen by Scott (Community Imports)
and removed
Needs: Triage
This issue needs triage. The team needs to decide who should own it, what to do, by when. [managed]
Needs: Lead
labels
Nov 20, 2023
scottbarnes
removed
the
Lead: @scottbarnes
Issues overseen by Scott (Community Imports)
label
Nov 20, 2023
scottbarnes
added a commit
to scottbarnes/openlibrary
that referenced
this issue
Jan 5, 2024
Import AMZ records as `staged`. See internetarchive#8541
scottbarnes
added a commit
to scottbarnes/openlibrary
that referenced
this issue
Jan 5, 2024
Import AMZ records as `staged`. See internetarchive#8541
scottbarnes
added a commit
to scottbarnes/openlibrary
that referenced
this issue
Jan 5, 2024
Import AMZ records as `staged`. See internetarchive#8541
scottbarnes
added a commit
to scottbarnes/openlibrary
that referenced
this issue
Jan 5, 2024
Import AMZ records as `staged`. See internetarchive#8541
scottbarnes
added a commit
to scottbarnes/openlibrary
that referenced
this issue
Jan 22, 2024
Import AMZ records as `staged`. See internetarchive#8541
scottbarnes
added a commit
that referenced
this issue
Feb 13, 2024
* Renable `/isbn` and AMZ imports This PR reenables AMZ imports from `/isbn` and `/api/books.json`. See this comment examples of how to use the endpoints and what to expect: #8690 (comment) The logic upon visiting `/isbn/[some isbn]` is now: - attempt to fetch the book from the OL database; - attempt to fetch the book from the `import_item` table (likely ISBNdb); - attempt to fetch the metadata from the Amazon Products API, clean that metadata for import, add the as a `staged` import in the `import_item` table, and then immediately import it `load()`, by way of `ImportItem.import_first_staged()`. If any of these find or create an edition, the ention is returned. * Stop bulk imports from AMZ records Import AMZ records as `staged`. See #8541 * Modify the affiliate server to accept a GET parameter, `high_priority`, at `/isbn`. E.g., `http://localhost:31337/isbn/059035342X?high_priority=true`. `high_priority=true` will put the ISBN straight to the front of the queue for an AMZ Products API look up, and attempt for three seconds to fetch the cached AMZ data (if it becomes available), returning that data, marshalled into a form suitable for creating an Edition, if possible. * Use `high_priority=false` (the default) on the affiliate server to fetch AM data if available,then queue for import and immediately import the item, returning the resulting `Edition`, or `None`. * Feature: `/api/books` will attempt to import from ISBN - adds an `high_priority` parameter to `/api/books` to make the API try to import books from ISBN. - relies on changes to `Edition.from_isbn()` which attempt to import editions first from `staged` items in the `import_item` table, and second from Amazon via the affiliate server. --------- Co-authored-by: Mek <michael.karpeles@gmail.com>
Achorn
pushed a commit
to Achorn/openlibrary
that referenced
this issue
Mar 14, 2024
* Renable `/isbn` and AMZ imports This PR reenables AMZ imports from `/isbn` and `/api/books.json`. See this comment examples of how to use the endpoints and what to expect: internetarchive#8690 (comment) The logic upon visiting `/isbn/[some isbn]` is now: - attempt to fetch the book from the OL database; - attempt to fetch the book from the `import_item` table (likely ISBNdb); - attempt to fetch the metadata from the Amazon Products API, clean that metadata for import, add the as a `staged` import in the `import_item` table, and then immediately import it `load()`, by way of `ImportItem.import_first_staged()`. If any of these find or create an edition, the ention is returned. * Stop bulk imports from AMZ records Import AMZ records as `staged`. See internetarchive#8541 * Modify the affiliate server to accept a GET parameter, `high_priority`, at `/isbn`. E.g., `http://localhost:31337/isbn/059035342X?high_priority=true`. `high_priority=true` will put the ISBN straight to the front of the queue for an AMZ Products API look up, and attempt for three seconds to fetch the cached AMZ data (if it becomes available), returning that data, marshalled into a form suitable for creating an Edition, if possible. * Use `high_priority=false` (the default) on the affiliate server to fetch AM data if available,then queue for import and immediately import the item, returning the resulting `Edition`, or `None`. * Feature: `/api/books` will attempt to import from ISBN - adds an `high_priority` parameter to `/api/books` to make the API try to import books from ISBN. - relies on changes to `Edition.from_isbn()` which attempt to import editions first from `staged` items in the `import_item` table, and second from Amazon via the affiliate server. --------- Co-authored-by: Mek <michael.karpeles@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Lead: @mekarpeles
Issues overseen by Mek (Staff: Program Lead) [managed]
Module: Import
Issues related to the configuration or use of importbot and other bulk import systems. [managed]
Priority: 2
Important, as time permits. [managed]
Type: Feature Request
Issue describes a feature or enhancement we'd like to implement. [managed]
When importing via
/isbn
,Edition.from_isbn()
is used, and that code:import_item
table is checked forstaged
items; thenimport_item
, an import is attempted from Amazon (note: this code path is currently disabled).Step 3 above should be moved to the affiliate-server, which should be modified to take a new
GET
param for/submit
(say,?import=1
), then:core/model.py Edition.from_isbn
for an example of this code;import_item
asstaged
and then we immediately calldo_import
(or callload()
, or make it anImportItem
object and call a class method to import) on that record and wait for the result;openlibrary/scripts/affiliate_server.py
Line 210 in 7bf8200
@mekarpeles
The text was updated successfully, but these errors were encountered: