Skip to content

Added Biblioreads support - #419

Merged
svera merged 51 commits into
developfrom
biblioreads
Nov 6, 2026
Merged

svera merged 51 commits into
developfrom
biblioreads

Conversation

@svera

@svera svera commented Oct 29, 2026

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Unresolved critical issues prevent existing installations from starting after upgrade, repeatedly reload anonymous authentication pages, and allow provider-supplied rating counts to inject executable markup.

6 open issues
What changed in this PR

Adds BiblioReads integration to Coreander, connecting indexed documents with Goodreads ratings, reviews, and book and author links.

Changes:

  • Adds configurable review-source enrichment, caching, matching, and persistent provider data.
  • Introduces asynchronous ratings and reviews, score filtering and sorting, link correction, and background progress displays.
  • Updates author-link storage, translations, documentation, and regression coverage.
File Description
README.md Documents integration, configuration, and privacy implications.
main.go Wires providers, background enrichment, and index opening.
internal/​webserver/​webserver.go Registers score helpers and progress-cache bypass.
internal/​webserver/​webserver_test.go Adds provider-aware application and score fixtures.
internal/​webserver/​upload_test.go Updates controller construction.
internal/​webserver/​update_auth_test.go Tests review-link editing authorization.
internal/​webserver/​series_test.go Tests score sorting and series tie-breaks.
internal/​webserver/​routes.go Adds progress, score, review, and link-editing routes.
internal/​webserver/​model/​highlight_repository.go Applies score filters to highlights.
internal/​webserver/​middleware.go Supplies background progress to templates.
internal/​webserver/​js-tests/​search-filter-utils.test.mjs Tests clearing input and select ranges.
internal/​webserver/​highlights_test.go Covers score-filter boundaries and unrated documents.
internal/​webserver/​embedded/​views/​series/​list.html Passes source labels to sorting controls.
internal/​webserver/​embedded/​views/​partials/​sort.html Labels provider-score sorting options.
internal/​webserver/​embedded/​views/​partials/​similar-to-banner.html Passes source labels to related-result sorting.
internal/​webserver/​embedded/​views/​partials/​searchbox.html Passes source labels to home filters.
internal/​webserver/​embedded/​views/​partials/​search-type-tabs.html Passes source labels to search sorting.
internal/​webserver/​embedded/​views/​partials/​search-filters-sidebar-content.html Passes source labels to sidebar filters.
internal/​webserver/​embedded/​views/​partials/​navbar.html Passes source labels to navigation filters.
internal/​webserver/​embedded/​views/​partials/​main.html Uses the shared background-progress partial.
internal/​webserver/​embedded/​views/​partials/​highlights-list-fragments.html Preserves source labels during highlight updates.
internal/​webserver/​embedded/​views/​partials/​document-score.html Displays ratings, editing controls, and review loading.
internal/​webserver/​embedded/​views/​partials/​document-score-filter-control.html Adds score-bound selectors.
internal/​webserver/​embedded/​views/​partials/​document-reviews.html Renders reviews, stars, dates, and spoilers.
internal/​webserver/​embedded/​views/​partials/​document-reviews-skeleton.html Adds review loading placeholders.
internal/​webserver/​embedded/​views/​partials/​document-reviews-header.html Adds review links and language selection.
internal/​webserver/​embedded/​views/​partials/​document-review-link-form.html Adds validated book-link editing form.
internal/​webserver/​embedded/​views/​partials/​document-metadata.html Shows stored or asynchronously loaded scores.
internal/​webserver/​embedded/​views/​partials/​document-metadata-filters.html Adds score-range filters.
internal/​webserver/​embedded/​views/​partials/​docs-list-item.html Enables stored scores in document lists.
internal/​webserver/​embedded/​views/​partials/​docs-list-fragments.html Preserves source labels during list updates.
internal/​webserver/​embedded/​views/​partials/​count-and-sort.html Forwards source labels to sorting controls.
internal/​webserver/​embedded/​views/​partials/​completed-list.html Forwards source labels in completed lists.
internal/​webserver/​embedded/​views/​partials/​background-progress.html Displays and polls concurrent task progress.
internal/​webserver/​embedded/​views/​partials/​author-summary.html Renders provider-based author links.
internal/​webserver/​embedded/​views/​partials/​author-summary-doc-detail.html Renders provider links in compact author summaries.
internal/​webserver/​embedded/​views/​partials/​author-data-source-link.html Adds reusable provider-link rendering.
internal/​webserver/​embedded/​views/​layout.html Passes background progress into the main partial.
internal/​webserver/​embedded/​views/​highlight/​list.html Adds source-aware filtering and sorting labels.
internal/​webserver/​embedded/​views/​document/​detail.html Integrates asynchronous reviews and author links.
internal/​webserver/​embedded/​views/​author/​list.html Adds provider links and source-aware sorting labels.
internal/​webserver/​embedded/​translations/​ru.yml Adds Russian review and progress strings.
internal/​webserver/​embedded/​translations/​fr.yml Adds French review and progress strings.
internal/​webserver/​embedded/​translations/​es.yml Adds Spanish review and progress strings.
internal/​webserver/​embedded/​translations/​de.yml Adds German review and progress strings.
internal/​webserver/​embedded/​js/​search-filter-utils.js Supports select-based range clearing.
internal/​webserver/​embedded/​js/​document-reviews.js Controls review expansion and overflow detection.
internal/​webserver/​embedded/​js/​datetime.js Formats dates after asynchronous updates.
internal/​webserver/​embedded/​images/​goodreads.svg Adds the Goodreads icon.
internal/​webserver/​embedded/​css/​display.css Styles review loading, clamping, and fractional stars.
internal/​webserver/​document_detail_test.go Updates index fixtures and provider wiring.
internal/​webserver/​controller/​series/​documents.go Adds score sorting with series-order tie-breaks.
internal/​webserver/​controller/​search/​search.go Exposes score sorting options.
internal/​webserver/​controller/​search/​parse.go Parses score ranges and sorting parameters.
internal/​webserver/​controller/​document/​update_review_link.go Handles book-link corrections and validation errors.
internal/​webserver/​controller/​document/​score.go Loads scores asynchronously with a timeout.
internal/​webserver/​controller/​document/​reviews.go Loads localized reviews and sanitizes review HTML.
internal/​webserver/​controller/​document/​detail.go Supplies review state and author-provider links.
internal/​webserver/​controller/​document/​controller.go Defines review-provider and stored-score support.
internal/​webserver/​controller/​author/​update.go Supplies provider links after author edits.
internal/​webserver/​controller/​author/​summary.go Supplies provider links in asynchronous summaries.
internal/​webserver/​controller/​author/​documents.go Adds author links and score sorting options.
internal/​webserver/​controller/​author/​controller.go Supports injectable author-link providers.
internal/​webserver/​controller.go Passes review and link providers to controllers.
internal/​webserver/​author_summary_test.go Tests localized and alternative provider links.
internal/​index/​textrank_related_test.go Uses provider-aware document indexing.
internal/​index/​search_filter_scoring_test.go Uses provider-aware document fixtures.
internal/​index/​rebuild_authors_test.go Tests link preservation during author rebuilding.
internal/​index/​progress.go Adds named provider-enrichment progress.
internal/​index/​document.go Defines provider payload storage and score fields.
internal/​index/​bleve.go Updates mappings and initializes enrichment workers.
internal/​index/​bleve_textrank_write.go Preserves provider data during TextRank writes.
internal/​index/​bleve_textrank_write_test.go Uses provider-aware indexing in TextRank tests.
internal/​index/​bleve_provider_preservation_test.go Tests preservation across independent enrichment writes.
internal/​index/​bleve_file_hash_test.go Updates document indexing in hash tests.
internal/​index/​bleve_document_write.go Schedules enrichment and reports background progress.
internal/​index/​bleve_document_read.go Hydrates provider data and filters or sorts scores.
internal/​index/​bleve_document_enrich.go Adds generic provider-enrichment processing.
internal/​index/​bleve_document_data_sources.go Adds locked provider updates and link persistence.
internal/​index/​bleve_author_write.go Stores provider links and manages refresh ownership.
internal/​index/​bleve_author_read.go Decodes stored author-link maps.
internal/​index/​bleve_author_migrate.go Migrates legacy author links into the new schema.
internal/​index/​authors_enrich_test.go Tests ownership-aware author-link refreshes.
internal/​index/​author.go Replaces dedicated links with a provider-link map.
internal/​index/​author_search_test.go Uses provider-aware document fixtures.
internal/​datasource/​wikidata/​service.go Exposes Wikipedia author links through the provider interface.
internal/​datasource/​wikidata/​service_test.go Tests link ownership and localized Wikipedia links.
internal/​datasource/​wikidata/​httpclient.go Reuses shared JSON HTTP helpers.
internal/​datasource/​wikidata/​httpclient_test.go Removes retry-parser tests moved to shared helpers.
internal/​datasource/​wikidata/​author.go Exposes metadata-owned links as a map.
internal/​datasource/​model/​review.go Defines shared score, review, and error models.
internal/​datasource/​model/​data_source_link.go Defines provider-link display metadata.
internal/​datasource/​model/​author.go Adds link retrieval and ownership contracts.
internal/​datasource/​httpjson/​httpjson.go Adds shared HTTP, JSON, and retry helpers.
internal/​datasource/​httpjson/​httpjson_test.go Tests shared response and retry handling.
internal/​datasource/​biblioreads/​throttle_test.go Tests per-instance throttling and cancellation.
internal/​datasource/​biblioreads/​reviews.go Adapts BiblioReads scores, reviews, and links.
internal/​datasource/​biblioreads/​reviews_test.go Tests link generation and correction validation.
internal/​datasource/​biblioreads/​model.go Defines BiblioReads response models.
internal/​datasource/​biblioreads/​matching.go Matches titles and authors and parses ratings.
internal/​datasource/​biblioreads/​fixtures/​search-books.json Adds a book-search response fixture.
internal/​datasource/​biblioreads/​fixtures/​book-scraper.json Adds a book-details response fixture.
internal/​datasource/​biblioreads/​fixtures/​author-info.json Adds an author-information response fixture.
internal/​datasource/​biblioreads/​document.go Defines persisted Goodreads lookup state.
internal/​datasource/​biblioreads/​cache.go Adds expiring in-memory response storage.
internal/​datasource/​biblioreads/​cache_test.go Tests cache isolation, expiry, and failover behavior.
internal/​datasource/​biblioreads/​adapter.go Connects matching and persistence to enrichment.
index_migration_test.go Tests author migration without document reindexing.
cli_input.go Adds and validates review-source settings.
cli_input_test.go Tests settings, URL validation, and configuration precedence.

Review effort: Balanced

Comment thread main.go Resolved
Comment thread internal/index/bleve_author_write.go Resolved
Comment thread internal/webserver/middleware.go Resolved

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔵 Needs a closer look

Lookup failures can permanently suppress retries, default enrichment sends automated requests to public instances contrary to their hosting guidance, and zero-valued score filters cannot be reliably applied or cleared.

No open issues 🎉

4 previously missed issues

In code that hasn't changed since last review

Medium severity Failed BiblioReads lookups are incorrectly saved as completed

internal/​datasource/​biblioreads/​adapter.go:161

BiblioReads returns HTTP 404 for upstream fetch or JSON failures, which the client exposes as an ordinary error. If both searches fail this way, this branch logs the errors and then persists Enriched: true with no URL, suppressing future lookups until a forced reindex. Return the error instead so failed lookups remain pending rather than becoming saved non-matches.

Medium severity Range-clear button ignores the active zero score filter

internal/​webserver/​embedded/​js/​search-filter-utils.js:115

When the upper-bound select is set to “No score” (0) and the lower bound is blank, the range-clear button remains disabled: hasValue explicitly treats "0" as empty. This is now an active filter, not an unset numeric input. Treat nonempty select values as active so users can clear the unrated-only filter with this button.

Medium severity Home search drops the zero-valued review score upper bound

internal/​webserver/​embedded/​views/​partials/​document-score-filter-control.html:8

Selecting “No score” as the upper bound in the home-page search does not apply this filter. home-search.js's collectPanelParams discards values equal to "0", so review-score-to is omitted and the server defaults it to 5; with no other criteria, submission does nothing. Update that serializer to preserve the zero-valued review-score bound.

Medium severity Default public endpoints send automated requests without permission

main.go:109

The linked BiblioReads README asks direct API and automation users to host their own instance. Enabling reviews by default with public-instance fallback instead sends library-wide automated requests to those services when documents need enrichment. Require explicitly configured self-hosted endpoints, or endpoints whose operators permit automation, and update the defaults and documentation accordingly.

6 resolved since last review

Review effort: Balanced

@svera svera closed this Nov 6, 2026
@svera svera reopened this Nov 6, 2026
@svera
svera requested a balanced review from Copilot November 6, 2026 08:17

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@svera
svera merged commit 6ea44e8 into develop Nov 6, 2026
1 check passed
@svera
svera deleted the biblioreads branch November 6, 2026 08:21
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.

2 participants