Skip to content

Fix joined narrator credits in ABS sidecars - #362

Open
jickell wants to merge 2 commits into
Chaptarr:developfrom
jickell:fix/abs-joined-narrators
Open

jickell wants to merge 2 commits into
Chaptarr:developfrom
jickell:fix/abs-joined-narrators

Conversation

@jickell

@jickell jickell commented Nov 13, 2026 •

Copy link
Copy Markdown

Description

The importer can store two narrator credits joined with +, while the ABS exporter only splits commas and semicolons. The exported narrators array can therefore retain the joined string alongside the individual edition credits.

Recognize the existing space-plus-space join delimiter before trimming and case-insensitive deduplication. Add regression coverage for joined credits from the file/edition/book inputs and preserve literal plus signs such as C++ Narrator and First+Second.

This changes credit formatting only. It does not choose a different edition, change the underlying source tags, or establish who narrated a particular recording. The regression test exercises the exporter directly; existing untracked sidecars are still protected by the metadata service's ownership rules.

Fixes #361

Database Migration

No.

How was this tested?

On macOS arm64 with .NET SDK 10.0.404, against develop commit 04c1ed1fba2ba08b72ea5e80f85578eaa076ffe3:

dotnet test src/Chaptarr.Core.Test/Chaptarr.Core.Test.csproj --filter FullyQualifiedName~AudioBookShelfMetadataFixture
  • With the new tests and the original exporter: 1 failed, 19 passed. The failure retains the joined narrator string instead of the first individual name.
  • With the splitter change: all 20 tests pass.
  • The cases also cover comma/semicolon fallbacks, case-insensitive duplicates and plus signs that are not the join delimiter.
  • git diff --check passes.

Screenshots (UI changes only)

N/A.

Summary by CodeRabbit

  • Bug Fixes
    • Narrator and name entries separated by " + " are now recognized as separate names, while plus signs without that exact spacing remain part of the name.
    • Comma- and semicolon-separated names continue to be supported.

@coderabbitai

coderabbitai Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Explain Change →

Important

Review skipped

Review was skipped as selected files did not have any reviewable changes.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 88d668be-599e-4a7c-af17-5f23a30c099d
Commits

Reviewing files that changed from the base of the PR and between 26c0d59 and 0748854.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

No actionable comments were generated in the recent review.

Walkthrough

The AudioBookShelf metadata exporter now splits narrator strings on " + " as well as commas and semicolons. New tests cover joined narrator credits, case-insensitive deduplication across sources, and names with literal plus signs.

Changes: Narrator Name Splitting

Layer / File(s) Summary
Split joined narrator credits
src/NzbDrone.Core/Extras/Metadata/Consumers/AudioBookShelf/AudioBookShelfMetadata.cs, src/Chaptarr.Core.Test/Extras/Metadata/AudioBookShelfMetadataFixture.cs
SplitNames recognizes " + " as a separator. Tests verify joined credits split, narrator names from multiple sources deduplicate case-insensitively, and plus signs without that separator remain part of a name.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Low

Merge Risk: Minimal · previous review 26c0d

Joined narrator credits separated by " + " are now exported as individual narrators, while names with literal plus signs such as "C++ Narrator" stay intact. The change is narrow and tested, and no actionable merge risk remains.

Security architecture risk: Minimal · up to 26c0d

The change only separates joined narrator credits in exported metadata. It does not expand access, change output destinations, or alter which edition is selected. No introduced or worsened security issue was identified.

Retained concerns
No architecture-level concerns identified.

Security review details

Security Blast Radius

  • inferred — The changed input interpretation affects narrator values in eligible sidecar output. Within the inspected path, even attacker-influenced narrator text remains metadata content rather than gaining control over destination selection, identity, or privileges.

Trust Boundaries and Controls

  • observed — The exporter continues to return serialized content in a MetadataFileResult with overwriteExisting enabled. This policy predates the change; the delimiter does not influence it. Returning this result does not itself establish downstream authorization to overwrite an existing sidecar.
Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title "Fix joined narrator credits in ABS sidecars" matches the main change. The PR makes the ABS exporter split narrator names on the " + " join delimiter, so the exported narrators array lists i…
Description check Passed The description covers the required template sections. It explains the change and why it is needed, and it links the issue with "Fixes #361". It states that no database migration is needed. It gives d…
Linked Issues check Passed Issue #361 requires the ABS sidecar narrators array to list each narrator once when a file credit joins edition narrator names with +. The change at head adds " + " to the delimiter array in `Au…
Out of Scope Changes check Passed The diff at head changes two files only. One is the ABS exporter SplitNames delimiter list, a one-line change directly tied to #361. The other is AudioBookShelfMetadataFixture.cs, which adds regre…
Full details: Title check

Explanation

The title "Fix joined narrator credits in ABS sidecars" matches the main change. The PR makes the ABS exporter split narrator names on the " + " join delimiter, so the exported narrators array lists individual names. The title is short, specific, and states the primary change.

Full details: Description check

Explanation

The description covers the required template sections. It explains the change and why it is needed, and it links the issue with "Fixes #361". It states that no database migration is needed. It gives detailed test steps on macOS arm64 with the .NET SDK, including before and after results. The screenshots section is marked N/A. The description clearly identifies scope and limits. The AI note in the template does not require content from the author.

Full details: Linked Issues check

Explanation

Issue #361 requires the ABS sidecar narrators array to list each narrator once when a file credit joins edition narrator names with +. The change at head adds " + " to the delimiter array in AudioBookShelfMetadata.SplitNames (src/NzbDrone.Core/Extras/Metadata/Consumers/AudioBookShelf/AudioBookShelfMetadata.cs). The split runs before the existing Trim() and the non-empty filter, so joined names separate before trimming and deduplication. Comma and semicolon splitting is unchanged. The new test should_split_joined_narrator_credits_and_deduplicate_individual_names covers joined file, edition, and book credits, a semicolon fallback, and case-insensitive duplicates. The [TestCase("C++ Narrator")] and [TestCase("First+Second")] cases cover literal plus signs. The diff does not show the downstream deduplication code. The test expectations and the reported test run (20 passing after the change) support its behavior. The change does not alter edition selection or source tags, as the issue requires.

Full details: Out of Scope Changes check

Explanation

The diff at head changes two files only. One is the ABS exporter SplitNames delimiter list, a one-line change directly tied to #361. The other is AudioBookShelfMetadataFixture.cs, which adds regression tests for the same exporter behavior. No unrelated production code, configuration, or edition-selection logic is modified. The PR description states the change is limited to credit formatting, and the diff matches that statement.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3530e606-a5d6-4874-b078-0cab343704e3
Commits

Reviewing files that changed from the base of the PR and between 04c1ed1 and 26c0d59.

Files selected for processing: 2

  • src/Chaptarr.Core.Test/Extras/Metadata/AudioBookShelfMetadataFixture.cs
  • src/NzbDrone.Core/Extras/Metadata/Consumers/AudioBookShelf/AudioBookShelfMetadata.cs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

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] ABS sidecar duplicates joined narrator credits alongside individual names

1 participant