Add per-track artist to filename: 09_Titel_-_Kuenstler.flac
- Track model: add optional artist field (None = fall back to album artist) - organizer: append _-_<artist> to each filename - tagger: use track.artist over album.artist for the 'artist' tag - playlist: widen glob pattern to match new _-_<artist> suffix - tests: update assertions + add test for track-artist override Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
775f274d02
commit
255496bd1b
6 changed files with 41 additions and 18 deletions
|
|
@ -21,17 +21,17 @@ def test_generate_playlist_single_disc(tmp_path: Path):
|
|||
"""M3U für Single-CD: keine CD-Prefix, korrekte Dateinamen."""
|
||||
album = _make_album(n_tracks=2, n_discs=1)
|
||||
|
||||
# Dummy-Audiodateien im neuen Unterstrich-Schema
|
||||
(tmp_path / "01_Disc1_Song_1.flac").touch()
|
||||
(tmp_path / "02_Disc1_Song_2.flac").touch()
|
||||
# Dummy-Audiodateien mit Künstler-Suffix
|
||||
(tmp_path / "01_Disc1_Song_1_-_Artist.flac").touch()
|
||||
(tmp_path / "02_Disc1_Song_2_-_Artist.flac").touch()
|
||||
|
||||
playlist_path = generate_playlist(album, tmp_path)
|
||||
assert playlist_path.exists()
|
||||
|
||||
content = playlist_path.read_text()
|
||||
assert "#EXTM3U" in content
|
||||
assert "01_Disc1_Song_1.flac" in content
|
||||
assert "02_Disc1_Song_2.flac" in content
|
||||
assert "01_Disc1_Song_1_-_Artist.flac" in content
|
||||
assert "02_Disc1_Song_2_-_Artist.flac" in content
|
||||
# Kein CD-Prefix bei Single-Disc
|
||||
assert "CD1/" not in content
|
||||
|
||||
|
|
@ -44,16 +44,16 @@ def test_generate_playlist_multi_disc(tmp_path: Path):
|
|||
cd2 = tmp_path / "CD2"
|
||||
cd1.mkdir()
|
||||
cd2.mkdir()
|
||||
(cd1 / "01_Disc1_Song_1.flac").touch()
|
||||
(cd1 / "02_Disc1_Song_2.flac").touch()
|
||||
(cd2 / "01_Disc2_Song_1.flac").touch()
|
||||
(cd2 / "02_Disc2_Song_2.flac").touch()
|
||||
(cd1 / "01_Disc1_Song_1_-_Artist.flac").touch()
|
||||
(cd1 / "02_Disc1_Song_2_-_Artist.flac").touch()
|
||||
(cd2 / "01_Disc2_Song_1_-_Artist.flac").touch()
|
||||
(cd2 / "02_Disc2_Song_2_-_Artist.flac").touch()
|
||||
|
||||
playlist_path = generate_playlist(album, tmp_path)
|
||||
content = playlist_path.read_text()
|
||||
|
||||
assert "CD1/01_Disc1_Song_1.flac" in content
|
||||
assert "CD2/01_Disc2_Song_1.flac" in content
|
||||
assert "CD1/01_Disc1_Song_1_-_Artist.flac" in content
|
||||
assert "CD2/01_Disc2_Song_1_-_Artist.flac" in content
|
||||
|
||||
|
||||
def test_generate_playlist_filename(tmp_path: Path):
|
||||
|
|
@ -79,7 +79,7 @@ def test_generate_playlist_extinf_contains_title(tmp_path: Path):
|
|||
)
|
||||
],
|
||||
)
|
||||
(tmp_path / "01_Für_Elise.flac").touch()
|
||||
(tmp_path / "01_Für_Elise_-_A.flac").touch()
|
||||
playlist_path = generate_playlist(album, tmp_path)
|
||||
content = playlist_path.read_text()
|
||||
assert "#EXTINF:0,Für Elise" in content
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue