[BUG] Multi-narrator 'Full Cast' naming collapse + tag-dependent IsGraphicAudio detection make regular and dramatized editions path-identical, and upgrade-delete silently removes the other product
Maintainers usually reply within 7 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
Research direction
Start by reading FileNameBuilder.AddNarratorTokens, DetectGraphicAudioFromLocalTags, and the BookFile API resource and ManualImport handling described in the report. Trace how imports choose destination paths and how upgrade-delete handles a file already at that path. Done means regular and GraphicAudio editions cannot collide or silently delete each other, and the production type can be corrected through the import or API flow.
Written by the indexing model from the issue text.
Description
Describe the bug
Two related behaviors in Chaptarr's organizer and upgrade-delete path combined to permanently destroy files from two different products of the same book. We lost a Golden Son GraphicAudio Part 2 file and a Dark Age GraphicAudio file (permanently — no recycle bin), caused by the sequence below. Both can coexist only if their computed destination paths differ, and in specific cases they don't.
Behavior 1 — narrator-token collapse makes two products path-identical
FileNameBuilder.AddNarratorTokens collapses any edition with more than two narrators to the literal "Full Cast" in the folder name. Books with genuinely multi-narrator regular editions (Iron Gold, Dark Age) therefore compute the same folder/file path as their dramatized (GraphicAudio) counterparts, because both collapse to "Full Cast" and the {Book Title} token is identical. The graphicAudioSuffix is appended only when the BookFile.IsGraphicAudio flag is true — which leads to behavior 2.
Behavior 2 — IsGraphicAudio is not reliably set on import, so the suffix never applies
The flag comes from DetectGraphicAudioFromLocalTags (embedded tags) and title parsing at import time. A GraphicAudio file whose tags don't advertise it (our Dark Age GA m4b, grabbed via SABnzbd) imported with IsGraphicAudio=false, so it computed the same path as the regular edition: Dark Age - Full Cast/Dark Age.m4b. Nothing in the ManualImport payload can set this flag — it's not exposed on the BookFile API resource — so the operator cannot force it at import time.
Combined effect — the actual data loss
When a regular edition was later imported onto the same book (an upgrade in Chaptarr's view), the upgrade-delete path removed the file occupying the computed destination — the GraphicAudio file — and imported the regular file over it. The GA file was permanently deleted (no recycle bin configured). The same collision later struck in reverse during a manual restore: importing the GA file with replaceExistingFiles=true overwrote the regular file at the same computed path. Two products of the same book cannot coexist, and in both directions the loser is silently, permanently deleted.
To Reproduce
- Author a book whose regular edition has >2 narrators (e.g. Pierce Brown, Dark Age). Its computed folder is
Dark Age - Full Cast/. - Obtain a dramatized/GraphicAudio edition of the same book whose embedded tags do not identify it (or whose import path doesn't detect it). Import it via ManualImport. Its computed destination is also
Dark Age - Full Cast/Dark Age.m4b— identical. - Import the regular edition onto the same book with
replaceExistingFiles=true. The GA file at the shared path is deleted; the regular file takes its place. No warning that the destination belonged to a different product.
Expected behavior
- Two products of the same book (regular vs dramatized adaptation) should never compute identical destination paths. Options: include
AudioProductionType/IsGraphicAudioin the default naming tokens when set; or treat a destination occupied by a file flagged as a different production type as an occupied-destination conflict (reject/warn) rather than an upgrade to replace. - Upgrade-delete should not silently remove a file that is not a prior copy of the same product.
IsGraphicAudio/ production type should be settable through the BookFile API resource or ManualImport payload, so operators can correct misdetections without SQL.
System Information:
- OS: Docker on Unraid
- Chaptarr Version: 0.9.965.0
- Installation Method: Docker
- Download clients: NZBGet, qBittorrent, SABnzbd
Logs
Debug-log evidence from the session is available on request (import decision lines, [CLEAN-IMPORT] skips, computed paths both before and after the flag was set via SQL).
Additional context
We recovered both files from out-of-pipeline sources (the original torrent download dir; a re-grab via SABnzbd), set IsGraphicAudio=true via SQL on the BookFile rows, and Chaptarr's own rename then moved them to distinct … - GraphicAudio … folders — confirming the suffix mechanism works and the missing flag was the trigger. The recurring collision, though, is the "Full Cast" collapse plus tag-dependent detection: any multi-narrator regular book with an undetected dramatized counterpart is one upgrade away from silent permanent deletion.
This report was prepared with AI assistance and reviewed by the reporter before filing.
- Dominant language
- C#
- Stars
- 664
- Forks
- 48
- Avg merge
- 3d 5h
- Merged PRs (30d)
- 1
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Chaptarr/chaptarr
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 7 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Chaptarr/chaptarr#313 · 1 comment ·
Maintainers usually reply within 7 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 7 days
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 63/100
Maintainers usually reply within 7 days
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 7 days
All issues in Chaptarr/chaptarr
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Sector-Vestige/Sector-Vestige#476 ·
Maintainers usually reply within 1 day
-
S: Untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Trauma-Station/Trauma-Station#5058 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 2 days
-
Difficulty 1/5 Under an hour Newbie friendliness 75/100
HoffmanEngineering/3d-print-log-api#243 ·
Maintainers usually reply within 1 day
-
:books: documentation untriaged
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day