Underscore filename schema, classical detection, NameToUnix post-processing
Pop schema: TT_-_Artist_-_Title.ext Classical schema: TT_-_Performer_-_Komponist_-_Werk[-_Orchester_Dirigent].ext triggered when albumartist ≠ track artist (pianist vs composer) All spaces in names → underscores; separator _-_ between parts. Missing parts (orchestra, conductor) are omitted. models.py: added conductor/orchestra optional fields to TrackProposal. executor.py: sanitize_dir_names() tries NameToUnix first, falls back to detox. Called after all renames in a directory are complete. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
8bd48cf166
commit
5011cef4db
3 changed files with 96 additions and 12 deletions
|
|
@ -196,10 +196,11 @@ def test_proposed_filename_single_disc() -> str:
|
|||
from executor import _proposed_filename
|
||||
from models import TrackProposal
|
||||
from pathlib import Path
|
||||
# Pop schema: albumartist == track artist → TT_-_Artist_-_Title
|
||||
tp = TrackProposal(path=Path("dummy.mp3"), title="Dancing Queen",
|
||||
artist="ABBA", track_number=1, disc_number=None)
|
||||
name = _proposed_filename(tp, ".mp3")
|
||||
assert name == "01 - ABBA - Dancing Queen.mp3", f"got: {name!r}"
|
||||
name = _proposed_filename(tp, ".mp3", albumartist="ABBA")
|
||||
assert name == "01_-_ABBA_-_Dancing_Queen.mp3", f"got: {name!r}"
|
||||
return name
|
||||
|
||||
|
||||
|
|
@ -207,10 +208,11 @@ def test_proposed_filename_multi_disc() -> str:
|
|||
from executor import _proposed_filename
|
||||
from models import TrackProposal
|
||||
from pathlib import Path
|
||||
# Classical schema: albumartist (performer) ≠ track artist (composer)
|
||||
tp = TrackProposal(path=Path("dummy.flac"), title="Toccata",
|
||||
artist="Bach", track_number=7, disc_number=2)
|
||||
name = _proposed_filename(tp, ".flac")
|
||||
assert name == "2-07 - Bach - Toccata.flac", f"got: {name!r}"
|
||||
name = _proposed_filename(tp, ".flac", albumartist="Gardiner")
|
||||
assert name == "2-07_-_Gardiner_-_Bach_-_Toccata.flac", f"got: {name!r}"
|
||||
return name
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue