feat: add ebook mode to search, automatically filtering for borrowable ebooks#11826
Conversation
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Pull request overview
This PR adds an ebooks mode to the Open Library OPDS /search endpoint that automatically filters search results to include only borrowable ebooks. When mode=ebooks is set (now the default), the endpoint appends ebook_access:[borrowable TO *] to the search query unless it already contains an ebook_access: filter.
Changes:
- Added
modeparameter to/opds/searchendpoint with default value of "ebooks" - Implemented automatic query filtering to append
ebook_access:[borrowable TO *]when mode is "ebooks" and the filter isn't already present - Modified the search query construction to use the filtered query when mode is "ebooks"
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
As @ronibhakta1 mentions, this PR introduces a This PR assumes the default is The opds workflow, from an app's perspective, is that the app will load Open Library's opds feed, will discover that there is a search URL, and then the search URL will be used for searches. Likely what we want is to have a search URL which also publishes that facets are available for Currently, the PR open has a few problems:
|
…dundant ebook_access filter
|
LGTM |
mekarpeles
left a comment
There was a problem hiding this comment.
Changes now LGTM w/ facet approach + mode
|
Hi, is the default now that it defaults to ebooks only? @mekarpeles @ronibhakta1 . In the PR I see |
Closes # ArchiveLabs/pyopds2_openlibrary#23
Fix:
mode=ebooksto Open Library opds/searchURL (by default) and this should update the query to includeebook_access:[borrowable TO *]if it’s not presentTechnical
Testing
Screenshot
Stakeholders
@MarcCoquand @mekarpeles