Skip to content

Don't flag same-title books in different languages as duplicates - #40

Closed
eszter007 wants to merge 3 commits into
crosspoint-reader:mainfrom
eszter007:feat/duplicates-language
Closed

eszter007 wants to merge 3 commits into
crosspoint-reader:mainfrom
eszter007:feat/duplicates-language

Conversation

@eszter007

Copy link
Copy Markdown

Draft. Builds on #38 and needs #36. This branch sits on top of #38, so until #38 is merged its two commits show up here too; only the last commit is new. It also uses the language field from #36. Without #36 the field is never set, and the check behaves exactly as in #38.

The duplicate notice compares title and author. I have books whose title doesn't change between languages: "1984" in English and in German, or a German edition of a book I first read in English with the same title. Those got offered for merging.

Now, when both books have a language and they differ, they don't count as duplicates. Only the main subtag is compared, so "en" and "en-GB" still match. If either book has no language, it works like before.

Two tests added next to the ones from #38: different languages are kept apart, and a regional variant still counts as the same language. The full Library test file passes (8 tests) on Node 24.

Eszter added 3 commits October 24, 2026 19:08
The duplicate check kept only a-z and 0-9, so two different Japanese titles
that share a number (e.g. two Kumon workbooks for 1st grade) both became "1"
and were offered for merging.
Dropping marks made Thai titles that differ only in a tone mark look
the same: ป่า (forest) and ป้า (aunt) both became "ป า". Hindi and
Arabic vowel signs had the same problem.
Editions in two languages can share a title, like "1984" in English and
in German. When both books have a language and the main subtags differ,
they aren't offered for merging. A missing language still matches, and
"en" matches "en-GB".
@coderabbitai

coderabbitai Bot commented Oct 24, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • 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.

@eszter007 eszter007 closed this Oct 24, 2026
@eszter007
eszter007 deleted the feat/duplicates-language branch October 24, 2026 17:57
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