Repository navigation
feat: store a book's language - #36
Merged
itsthisjustin merged 1 commit intoOct 24, 2026
Merged
Conversation
Devices send the EPUB's dc:language in progress metadata; PUT /documents/:document/info sets it by hand.
|
Warning Review limit reachedYou'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 40 minutes. View limit details
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. Comment |
itsthisjustin
self-requested a review
October 24, 2026 13:30
itsthisjustin
approved these changes
Oct 24, 2026
This was referenced Oct 24, 2026
eszter007
added a commit
to eszter007/matcha-reader
that referenced
this pull request
Oct 24, 2026
crosspoint-sync can store a book's language (crosspoint-reader/crosspoint-sync#36). Send the EPUB's dc:language as "language" in the progress metadata, next to ISBN and series, when the server is a custom (extended metadata) one. The value comes from the book cache, so it costs no extra read.
eszter007
added a commit
to eszter007/matcha-reader
that referenced
this pull request
Oct 24, 2026
crosspoint-sync can store a book's language (crosspoint-reader/crosspoint-sync#36). Send the EPUB's dc:language as "language" in the progress metadata to CrossPoint and custom servers; plain KOSync has no such field. The value comes from the book cache, so it costs no extra read.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The server doesn't know what language a book is in. That matters to me because I read in German, English and Japanese, and I'd like the app and stats to tell them apart. This adds a
languagefield to each book.Where the language comes from
"language": "ja", the EPUB'sdc:language, next totitleandauthors. It only fills a blank. A value that isn't a BCP 47 tag is ignored, and the sync still succeeds.PUT /api/v1/documents/{document}/infotakeslanguage. A language set this way stays over later device syncs, andnullclears it so the next device sync fills it again.It's returned in
GET /api/v1/documentsandGET /api/v1/progress, and a merge fills a blank language from the merged-away book. One new column,documents.language(migration 0034, so it doesn't collide with 0033 in #35). The API docs are updated. No new endpoint: it's a new field on the existing metadata and/infocalls.Why not take it from Hardcover, like genres
Hardcover's search returns books, i.e. the abstract work. Language belongs to an edition: the English original, the German translation and the Japanese paperback are separate editions of one book, each with its own language. The search results carry no language at all, so it would take a second query for the editions, plus a guess at which edition this copy is. That guess is wrong exactly where language matters most: books read in translation. The reader has the actual file in hand, and its EPUB states the language, so the reader is the better source.
Testing
test/document-language.test.tscovers a malformed tag from a device being dropped, the language showing in both book lists, a manual value staying over a later device sync, clearing it back, and a merge filling a blank. Without the change inmerge.ts, the merge step fails the test. The full suite passes (675 tests), and so doestsc --noEmit.The X4 firmware doesn't send
languageyet. That would be a small follow-up on the CrossPoint side.