music-assistant-server

Branch:dev-lidarr-plugin

Commit Details

Treat narrators as a distinguishing field to prevent merging different recordings (#3230)

fix(audiobooks): treat narrators as a distinguishing field to prevent merging different recordings

Audiobooks with the same title and author but different narrators
(e.g. the same Harry Potter title read by Stephen Fry and Jim Dale)
were being merged into a single library item. This caused:
- Only one narrator to be retained in the merged item
- Chapter lists from all recordings to be concatenated, producing
  incorrect (doubled) chapter counts
- No way for clients to retrieve per-recording metadata via the API

Fix: in compare_audiobook(), add a narrator check before the author
comparison. When both items have narrators and no narrators are shared,
return False so they are treated as distinct recordings.

This change is safe for the single-narrator case: if either item has no
narrator metadata, the check is skipped and existing behaviour is
unchanged.

Co-authored-by: hayupadhyaya <[email protected]>
Forgejo

Author

hayupadhyaya<[email protected]>
February 24, 2026 at 08:17 AM UTC

Committer

February 24, 2026 at 08:17 AM UTC
6additions
0deletions
1file changed

Parent commits

Changes

1 file
+6-0

Changed Files (1)

music_assistant/helpers/
music_assistant/helpers/compare.py
+6