Skip to content

feat: set Hardcover's book details by hand - #46

Open
eszter007 wants to merge 4 commits into
crosspoint-reader:mainfrom
eszter007:feat/manual-moods
Open

eszter007 wants to merge 4 commits into
crosspoint-reader:mainfrom
eszter007:feat/manual-moods

Conversation

@eszter007

@eszter007 eszter007 commented Oct 25, 2026 •

Copy link
Copy Markdown

Every detail Hardcover fills in can now be set by hand, the way genres can since #35: moods, content warnings, description, series with its number, and release year. The community rating stays Hardcover's only, since it's other readers' average rather than a fact about the book.

  • PUT /documents/{document}/info takes them all. A value set there sticks over Hardcover's lookup (one <field>_manual column each, like genres_manual), and null hands the field back for the next lookup.
  • Lists (genres up to 10, moods and content warnings up to 12) replace the stored list and are spelled the way Hardcover's are, with the same tidy(): trimmed, one entry per name whatever the case, first letter capitalized. The web app counts mood and genre names exactly, so otherwise a manual "dark" would show apart from Hardcover's "Dark". This also changes manual genres, which were stored as typed.
  • description up to 6000 characters, the same cut Hardcover's get. release_year from 1 to 9999.
  • series and series_position go together. Setting a series by hand also drops Hardcover's series id, which points at the series Hardcover found, so next-in-series lookups stop for that book instead of following the wrong series. series_position without series is rejected.
  • Merging two copies keeps details set by hand over the other copy's, even a list cleared on purpose, and a series moves with its number. Before, the merge only carried genres, and a genre list cleared by hand on the kept copy took the other copy's Hardcover genres while staying marked as manual. The rest came back from the next lookup.
  • One table (src/models/manual-details.ts) lists these details and drives the route, the lookup's UPDATE and the merge's SQL, so a new one is added in one place. Column names in SQL only ever come from that table.

The migration is 0036, because #43 uses 0035.

Tests cover validation, sticking over a lookup, handing one field back while the others stay, the series id, and a merge, for both moods and the other details. docs/API.md is updated.

PUT /documents/{document}/info takes moods, up to 12 names. Like
manual genres they stick over Hardcover's lookup, null hands them back,
and a merge keeps them over the other copy's. Both lists share one
check.
@coderabbitai

coderabbitai Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 25 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: c175ddce-0229-439e-9870-14af99a757ee
Commits

Reviewing files that changed from the base of the PR and between 862ce30 and b426de3.

Files selected for processing: 9
  • docs/API.md
  • migrations/0036_manual_details.sql
  • src/models/cover.ts
  • src/models/hardcover-catalog.ts
  • src/models/manual-details.ts
  • src/models/merge.ts
  • src/routes/v1/documents.ts
  • test/manual-details.test.ts
  • test/manual-moods.test.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Manual lists go through the same tidy() as Hardcover's: trimmed, one
entry per name whatever the case, first letter capitalized. Otherwise
the web app's mood and genre counts, which compare names exactly,
would list a manual "dark" and Hardcover's "Dark" apart.
@eszter007
eszter007 marked this pull request as ready for review October 25, 2026 10:33
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-25T10:42:07.730698Z
We couldn’t complete this review. Comment @codex review to try again.
b426de3 Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Content warnings, description, series with its number, and release
year can be set through PUT /documents/{document}/info like genres and
moods: set by hand they stick over Hardcover's lookup, null hands them
back, and a merge keeps them. One table of these details drives the
route, the lookup and the merge. A series set by hand drops Hardcover's
series id, which points at the series Hardcover found.
@eszter007 eszter007 changed the title feat: set moods by hand, like genres feat: set Hardcover's book details by hand Oct 25, 2026
The kept copy's value now wins whenever it was set by hand, even empty.
Before, a list cleared on purpose took the other copy's Hardcover list
and kept the manual flag, so the lookup's values ended up frozen. The
genre merge from crosspoint-reader#35 had the same gap.
@eszter007
eszter007 marked this pull request as ready for review October 25, 2026 10:40

This branch has not been deployed

No deployments
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.

1 participant