Skip to content

Add support for series#11678

Merged
cdrini merged 15 commits intointernetarchive:masterfrom
cdrini:feature/series3
Mar 2, 2026
Merged

Add support for series#11678
cdrini merged 15 commits intointernetarchive:masterfrom
cdrini:feature/series3

Conversation

@cdrini
Copy link
Copy Markdown
Collaborator

@cdrini cdrini commented Jan 7, 2026

Closes #6718
Closes #7811
Closes #7814

Note: Adding/editing series via the UI is currently limited to super librarians via the edit page, just for a short while for ust to capture any bugs.

Technical

  • SPECIAL DEPLOY: New solr fields need to be created on our production solr before this can be deployed.

This stores series the core of series information on the work data structure, and has the series page query/aggregate to determine the members of the list. I'm still not entirely certain on this approach ; I think we might actually want to be make it redundant and stored in both spots. But I think this is a good bouncing off point for us to start from!

Known issues:

  • Lists/series aren't edition-aware (Making Lists Edition Aware #11246)
  • "Position" option should only appear on the series edit page, not lists
  • Series edit page should not be re-orderable

Future expansions/questions:

  • The series JSON endpoints doesn't work (based on lists JSON)
  • Will editing series correctly trigger solr-updater? Yes.
  • Question: Will the solr indexing correctly handle some series not having a position? Or will it throw off the zipping?
    • It's stored as an empty string!
  • Fix duplicate lists can easily be created.
  • Compendiums should be shown grouped at the bottom -- possibly extend with seed metadata for "groups"
  • The work search autocomplete endpoint is using different solr defaults and has subpar results
  • Will editing a work by someone without series-access cause it to erase the series?
    • No!
  • Does the series extractor still work? https://codepen.io/cdrini/full/xxQNbgZ
    • Yes! Will need to change the default url to /series/add after it's deployed.
  • Does editing a series name cause it's works to be re-indexed by solr-updater?

Testing

If you pull this locally (and make everything), you should see the new series editing options, and you'll see series showing up in the lists search!

Screenshot

Series as they appear in search results:

image

Series as they appear on the book page (design needs more work):
image

Series editing on the work edit page:

image

Stakeholders

@mheiman

Copy link
Copy Markdown

@accesslint accesslint bot left a comment

Choose a reason for hiding this comment

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

There are accessibility issues in these changes.

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 experimental Series support to Open Library, allowing works to be organized into series (e.g., Harry Potter, The Sword of Truth). Series are implemented as a special type of list with additional metadata for position tracking and are stored using the same OL###L identifier scheme as lists.

Key changes include:

  • Series data model integration with works, using bidirectional edges stored on work objects
  • Solr indexing for series fields (series_key, series_name, series_position) to enable search
  • UI components for creating, editing, and displaying series on work/edition pages

Reviewed changes

Copilot reviewed 31 out of 31 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
openlibrary/core/models.py Adds WorkSeriesEdge types, ListSeedMetadata, and series helper methods to Work class
openlibrary/core/lists/model.py Implements Series class extending List, refactors seed metadata handling
openlibrary/core/schema.py Comments out series sequence schema (OL%dS format)
openlibrary/core/processors/readableurls.py Adds URL processor for /series/ paths
openlibrary/solr/updater/work.py Fetches and indexes series data in work Solr documents
openlibrary/solr/updater/list.py Updates list updater to handle series type and list_type field
openlibrary/plugins/openlibrary/lists.py Adds series CRUD endpoints, implements work-series edge synchronization
openlibrary/plugins/upstream/addbook.py Adds series creation support and doc overloads
openlibrary/plugins/upstream/code.py Adds series to editable keys regex
openlibrary/plugins/worksearch/schemes/works.py Adds series fields to work search scheme
openlibrary/plugins/worksearch/schemes/lists.py Updates list search universe to include series
openlibrary/plugins/worksearch/code.py Populates series data in work search results
openlibrary/plugins/worksearch/autocomplete.py Adds series_autocomplete endpoint
openlibrary/templates/type/series/*.html Symlinks to list templates for series views
openlibrary/templates/type/list/view_body.html Updates edit permission logic to allow series editing
openlibrary/templates/type/list/edit.html Adds position field with temporary detection logic
openlibrary/templates/type/edition/title_and_author.html Displays primary series above work title
openlibrary/templates/books/series-autocomplete.html Series autocomplete input component
openlibrary/templates/books/edit.html Adds Work Series fieldset and refactors alert messages
openlibrary/macros/SearchResultsWork.html Displays series info in search results, fixes dict access patterns
openlibrary/plugins/openlibrary/js/index.js Initializes series autocomplete on edit pages
openlibrary/plugins/openlibrary/js/edit.js Implements initSeriesMultiInputAutocomplete function
openlibrary/plugins/openlibrary/code.py Calls register_types() for series type registration
static/css/components/*.less Adds styling for series display
conf/solr/conf/managed-schema.xml Defines series_key, series_name, series_position Solr fields
Makefile Adds series reindexing to reindex-solr target
openlibrary/i18n/messages.pot Adds internationalization strings for series features
openlibrary/catalog/utils/query.py Adds ?_raw=true parameter for list/series queries
openlibrary/tests/solr/updater/test_work.py Updates test helper to accept series parameter
Comments suppressed due to low confidence (1)

openlibrary/plugins/openlibrary/lists.py:444

  • The lists_delete endpoint only handles /lists/ paths but doesn't support /series/ paths. Series should also be deletable. Consider updating the path regex to include series or creating a separate delete endpoint for series.
class lists_delete(delegate.page):
    path = r"((?:/people/[^/]+)?/lists/OL\d+L)/delete"

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Member

@mekarpeles mekarpeles left a comment

Choose a reason for hiding this comment

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

data flow / approach lgtm, editing should be discussed w/ community

@RayBB RayBB mentioned this pull request Feb 12, 2026
@cdrini cdrini force-pushed the feature/series3 branch 3 times, most recently from 22db60f to 12e3279 Compare February 27, 2026 00:51
@cdrini cdrini changed the title Experiment with Series Add support for series Feb 27, 2026
@cdrini cdrini added the Needs: Special Deploy This PR will need a non-standard deploy to production label Feb 27, 2026
@cdrini cdrini marked this pull request as ready for review February 27, 2026 02:00
@cdrini cdrini force-pushed the feature/series3 branch 2 times, most recently from ed24e04 to 79fe5f9 Compare February 28, 2026 08:41
@cdrini cdrini force-pushed the feature/series3 branch from 0093fc1 to af1dc4d Compare March 2, 2026 17:28
@cdrini cdrini merged commit 0c807e2 into internetarchive:master Mar 2, 2026
4 of 5 checks passed
@cdrini cdrini deleted the feature/series3 branch March 2, 2026 17:45
@cdrini cdrini removed the Needs: Special Deploy This PR will need a non-standard deploy to production label Mar 2, 2026
@RayBB RayBB removed the On Testing label Mar 5, 2026
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.

Add series link/label to work page Allow basic librarian series creation Book Series

5 participants