Skip to content

fix(hardcover): carry author-work language from default editions (#2241) - #2246

Merged
vavallee merged 1 commit into
vavallee:mainfrom
kevinatlee:codex/2241-hardcover-author-language
Aug 27, 2026
Merged

vavallee merged 1 commit into
vavallee:mainfrom
kevinatlee:codex/2241-hardcover-author-language

Conversation

@kevinatlee

Copy link
Copy Markdown
Contributor

Summary

Hardcover author-work queries now select language through the default ebook and audio edition relations, allowing the existing hcBook/toBook() path to populate Book.Language. This prevents strict unknown-language profiles from rejecting matching Hardcover works while continuing to reject known non-allowed languages.

Closes #2241.

Why minimal

  • Reuses the default-edition language fields and conversion logic already used by Hardcover list/shelf queries.
  • Adds no database schema or model changes.
  • Adds no per-book request or API fan-out.
  • Does not change reconciliation or deletion behavior.

Checklist

  • Commits signed off with git commit -s
  • Tests added or updated
  • Doc-update gate cleared; this restores existing profile semantics without adding configuration or an API surface
  • Added a changelog fragment under changelog.d/

Test plan

  • go test -race ./internal/metadata/hardcover -count=1
  • go test ./internal/metadata/... -count=1
  • go build ./...
  • go vet ./...
  • golangci-lint run --timeout=5m (v2.11.4; 0 issues)

A repository-wide race run was also attempted locally. The changed Hardcover package passed, but the overall command did not complete cleanly on macOS: internal/api reached its 30-minute timeout and an existing downloader test hit the /var → /private/var temporary-directory symlink safety guard. Neither failure exercised this diff; the focused race test and all metadata tests pass.

…allee#2241)

Signed-off-by: Kevin Atlee <175901901+kevinatlee@users.noreply.github.com>
@github-actions github-actions Bot added the bindery-notified Discord notification already sent for this PR label Aug 26, 2026
@codecov

codecov Bot commented Aug 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@vavallee
vavallee merged commit 81513ab into vavallee:main Aug 27, 2026
43 checks passed
@kevinatlee

Copy link
Copy Markdown
Contributor Author

Follow-up from real-world testing after #2246: the original blank-language fix was necessary, but we found that Hardcover's default edition can itself be a translation, so using that edition's language as authoritative work-level language can produce false non-English classifications.

Penelope Douglas reproduced this strongly: 49/78 author works were rejected by an English-only profile, including Corrupt (por), Hideaway (por), Kill Switch (por), Bully (Spanish), and Nightfall (Spanish). An existing English Audible Corrupt row was consequently offered by catalogue reconciliation as a language-rejected stale row.

No files were deleted; #2247's preview/safeguards exposed the bad evidence before apply.

I've documented the reproduction in #2753 and submitted #2754 to resolve language from safer edition evidence while preserving the strict-profile behavior #2246 originally fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bindery-notified Discord notification already sent for this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A strict unknownLanguageBehavior silently deletes the entire Hardcover catalogue, because Hardcover author-works cannot carry a language

2 participants