Skip to content

make betterworldbooks async#12404

Merged
cdrini merged 3 commits into
masterfrom
fastapi/affiliate-links-async
Apr 18, 2026
Merged

make betterworldbooks async#12404
cdrini merged 3 commits into
masterfrom
fastapi/affiliate-links-async

Conversation

@RayBB

@RayBB RayBB commented Apr 17, 2026

Copy link
Copy Markdown
Collaborator

Part of #12254

Technical

Testing

Make sure prices are the same both on the html page and the prices api for testing and production:

Screenshot

Stakeholders

@RayBB RayBB changed the title make betterworld books async make betterworldbooks async Apr 17, 2026
@RayBB RayBB added On Testing Priority: 1 Do this week, receiving emails, time sensitive, . [managed] labels Apr 17, 2026

@cdrini cdrini left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm, tested on testing and saw BWB prices in the prices panel



def _get_betterworldbooks_metadata(
get_betterworldbooks_metadata = async_bridge.wrap(get_betterworldbooks_metadata_async)

@cdrini cdrini Apr 18, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be worthwhile migrating the /prices endpoint to fastapi! It's a tiny one used mainly internally, and will let us delete the bridge/sync version entirely!

@cdrini cdrini merged commit eaf18c5 into master Apr 18, 2026
7 checks passed
@cdrini cdrini deleted the fastapi/affiliate-links-async branch April 18, 2026 01:50
shoaib-inamdar added a commit to shoaib-inamdar/openlibrary that referenced this pull request Apr 25, 2026
- Add async GET /prices.json endpoint to openlibrary/fastapi/internal/api.py
- Uses get_betterworldbooks_metadata_async directly (no sync bridge needed)
- Falls back from ISBN-10 to ISBN-13 when BWB returns no price
- Add PriceResponse Pydantic model for schema documentation
- Mark legacy web.py price_api class as @deprecated('migrated to fastapi')
- Add 4 tests in openlibrary/tests/fastapi/test_price.py covering:
  missing params, isbn lookup, asin lookup, isbn-10 fallback to isbn-13

Part of internetarchive#11999
Pre-work: internetarchive#12404 (make betterworldbooks async)
IvanPisquiy06 pushed a commit to IvanPisquiy06/openlibrary that referenced this pull request Apr 27, 2026
IvanPisquiy06 pushed a commit to IvanPisquiy06/openlibrary that referenced this pull request Apr 27, 2026
Sadashii pushed a commit to Sadashii/openlibrary that referenced this pull request May 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

On Testing Priority: 1 Do this week, receiving emails, time sensitive, . [managed]

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants