Skip to content

Name the missing field when a manual import has no editionId - #351

Draft
elric667 wants to merge 2 commits into
Chaptarr:developfrom
elric667:fix/manual-import-edition-error
Draft

elric667 wants to merge 2 commits into
Chaptarr:developfrom
elric667:fix/manual-import-edition-error

Conversation

@elric667

@elric667 elric667 commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Summary

A ManualImport file without a numeric editionId was rejected with Edition must be selected for '<title>'.. The message is the same whether editionId was omitted or the caller sent foreignEditionId instead. Since foreignEditionId looks like the stable identifier in GET /api/v1/edition, API callers had no way to tell what was wrong. Fixes #108.

Change

ManualEditionSelectionMatchesBook now produces one of two messages.

Without foreignEditionId:

Edition must be selected for 'Elder Race': editionId is missing. Send the numeric editionId of one of its editions (GET /api/v1/edition?bookId=6).

With foreignEditionId on the file:

Edition must be selected for 'Elder Race': editionId is missing. foreignEditionId 'hc:edition:30447586-audiobook' is only used for metadata suggestions; for a book already in the library send the numeric editionId (GET /api/v1/edition?bookId=6).

Behaviour is unchanged: the file is still rejected. foreignEditionId keeps its existing meaning for metadata suggestions, so this PR doesn't start accepting it for library books. The UI validates the edition itself before sending, so this only affects API callers.

Testing

  • The existing test checks the new wording. A new test covers the foreignEditionId case, including trimming.
  • dotnet test --filter ManualImport: 160 pass.
  • The full Core suite matches develop: the only failures are the 3 that also fail on develop itself.

AI disclosure

This PR was written with Claude Code, using Claude Opus 5.5 (claude-opus-5-5, medium effort). I reviewed the change and the test results before submitting.

🤖 Generated with Claude Code

https://claude.ai/code/session_01GXPbRG8Geef4zMeMQgpQ8H

A ManualImport file without a numeric editionId was rejected with
"Edition must be selected for '<title>'.", whether editionId was
omitted or the caller sent foreignEditionId instead. foreignEditionId
looks like the stable identifier from GET /api/v1/edition, so API
callers had no way to tell what was wrong.

The message now says editionId is missing and points to
GET /api/v1/edition?bookId=<id>. When the file carries a
foreignEditionId, it also explains that foreignEditionId is only used
for metadata suggestions, and that a book already in the library needs
the numeric editionId. Behaviour is unchanged: the file is still
rejected.

Fixes Chaptarr#108

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GXPbRG8Geef4zMeMQgpQ8H
@coderabbitai

coderabbitai Bot commented Nov 8, 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

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.

[BUG] ManualImport requires numeric editionId but the error names no field; foreignEditionId is silently ignored

1 participant