Add bookshelf and profile#11476
Conversation
This PR adds the archive.org bookshelf and profile to links. At some point Openlibrary should have their own, if they support lending and buying from many different libraries and/or book sellers.
|
(a) we probably want this for all our endpoints and (b) we might want to stipulate that this link is for archive.org (as I can imagine the feed also returning Open Library specific profiles and bookshelves) |
|
Otherwise, given our feed didn't have anything before, I think it's fair for us to put this on testing to unblock your development! |
There was a problem hiding this comment.
Pull Request Overview
This PR adds archive.org bookshelf and profile links to the OPDS search endpoint to enable user-specific functionality for OPDS clients. The implementation integrates external archive.org services for managing user bookshelves and profiles.
- Adds two new OPDS link relations: shelf and profile
- Links point to archive.org services for user bookshelf and profile functionality
- Integration targets the OPDS search endpoint
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| Link( | ||
| rel="profile", | ||
| href="https://archive.org/services/loans/loan/?action=user_profile", | ||
| type="application/opds-profile+json", |
There was a problem hiding this comment.
The media type application/opds-profile+json is not a standard OPDS 2.0 media type. According to the OPDS specification, catalog/feed resources should use application/opds+json. Consider using application/opds+json or application/json depending on what the archive.org endpoint actually returns.
| type="application/opds-profile+json", | |
| type="application/opds+json", |
| Link( | ||
| rel="http://opds-spec.org/shelf", | ||
| href="https://archive.org/services/loans/loan/?action=user_bookshelf", | ||
| type="application/opds+json", | ||
| ), | ||
| Link( | ||
| rel="profile", | ||
| href="https://archive.org/services/loans/loan/?action=user_profile", | ||
| type="application/opds-profile+json", | ||
| ), |
There was a problem hiding this comment.
For consistency and proper OPDS catalog functionality, the bookshelf and profile links should also be added to the opds_home endpoint (around line 947). OPDS clients should be able to access these user-specific resources from the main catalog entry point as well.
Added OPDS links for user bookshelf and profile in the response.
for more information, see https://pre-commit.ci
This PR adds the archive.org bookshelf and profile to links.
At some point Openlibrary should have their own, if they support lending and buying from many different libraries and/or book sellers.
Testing
I've not tested this change yet.