Skip to content

Add bookshelf and profile#11476

Merged
mekarpeles merged 3 commits intointernetarchive:masterfrom
MarcCoquand:add-profile-and-bookshelf
Nov 18, 2025
Merged

Add bookshelf and profile#11476
mekarpeles merged 3 commits intointernetarchive:masterfrom
MarcCoquand:add-profile-and-bookshelf

Conversation

@MarcCoquand
Copy link
Copy Markdown
Contributor

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.

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.
@mekarpeles
Copy link
Copy Markdown
Member

(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)

@mekarpeles
Copy link
Copy Markdown
Member

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!

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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",
Copy link

Copilot AI Nov 18, 2025

Choose a reason for hiding this comment

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

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.

Suggested change
type="application/opds-profile+json",
type="application/opds+json",

Copilot uses AI. Check for mistakes.
Comment on lines +831 to +840
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",
),
Copy link

Copilot AI Nov 18, 2025

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
mekarpeles and others added 2 commits November 17, 2025 18:35
Added OPDS links for user bookshelf and profile in the response.
@mekarpeles mekarpeles merged commit 7bf4617 into internetarchive:master Nov 18, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants