[FEATURE] Language token for file/folder renaming (e.g. {Book Language})
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 72/100
Research direction
Start in src/NzbDrone.Core/Organizer/FileNameBuilder.cs, where the existing {Book ...} token handlers are, and check how Edition.Language in src/NzbDrone.Core/Books/Model/Edition.cs and Book.LanguageName / Book.LanguageCode in src/NzbDrone.Core/Books/Model/Book.cs are exposed. Add a handler for a language token that returns an empty string when no language is set. Done when a naming format containing the token renders the language code, and an unset language collapses inside a bracketed group.
Written by the indexing model from the issue text.
Description
Summary
Add a renaming token that outputs the language of the book/edition, so it can be used in the Media Management naming format.
Motivation
For mixed-language libraries (e.g. English and German audiobooks) there is currently no reliable way to distinguish editions by language in the file or folder name. The title can't be used as a proxy: German editions frequently keep the original English book title.
Example — Rebecca Yarros, "Threshing Day" (The Empyrean #3.5):
the German edition keeps the identical book title "Threshing Day" and only the series name differs (English "Fourth Wing" vs German "Flammengeküsst"). Relying on the series name is fragile, and the book title itself is identical across languages, so neither distinguishes the editions. Root folders are per-author and can't separate languages either, and there is no naming token for language.
Proposed solution
Add a token such as {Book Language} (and/or {Edition Language}) to the naming format.
The data already exists in the model, so this is mainly about exposing it:
Edition.Language(src/NzbDrone.Core/Books/Model/Edition.cs)Book.LanguageName/Book.LanguageCode(src/NzbDrone.Core/Books/Model/Book.cs)
Implementation would be a new token handler in
src/NzbDrone.Core/Organizer/FileNameBuilder.cs, alongside the existing {Book ...} handlers. Returning an empty string when no language is set would let it collapse cleanly inside a bracketed group, e.g. {(Book Language)} rendering (EN) / (DE) and disappearing when unknown.
Example
Same book, two language editions with an identical title — only the token tells them apart:
{Book Series}/{Book Title} ({Book Language})
Fourth Wing/Threshing Day (EN)
Flammengeküsst/Threshing Day (DE)
- Dominant language
- C#
- Stars
- 664
- Forks
- 48
- Avg merge
- 5h 47m
- Merged PRs (30d)
- 4
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
-
[BUG] MyAnonaMouse search turns a curly apostrophe into a space, so titles with ’ are never foundOpen
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 63/100
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
All issues in Chaptarr/chaptarr
Similar issues
-
bug module
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 78/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
Tichau/FileConverter#829 ·
Maintainers usually reply within 9 days
-
needs triage
Difficulty 1/5 Under an hour Newbie friendliness 71/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
majorsilence/Majorsilence.Forms#718 ·
Maintainers usually reply within 1 day