Einheitliches Dateinamen-Schema: 01_-_Titel_-_Kuenstler.flac

organizer: Separator vor Titel angleichen (war: 01_Titel_-_K., neu: 01_-_Titel_-_K.)
playlist: Glob-Pattern und Fallback auf neues Schema angepasst
tests: Assertions aktualisiert

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Dieter Schlüter 2026-02-18 00:22:54 +01:00
commit 4e6d82a41d
4 changed files with 21 additions and 21 deletions

View file

@ -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 mit Künstler-Suffix
(tmp_path / "01_Disc1_Song_1_-_Artist.flac").touch()
(tmp_path / "02_Disc1_Song_2_-_Artist.flac").touch()
# Dummy-Audiodateien im Schema 01_-_Titel_-_Künstler
(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_-_Artist.flac" in content
assert "02_Disc1_Song_2_-_Artist.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_-_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()
(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_-_Artist.flac" in content
assert "CD2/01_Disc2_Song_1_-_Artist.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_-_A.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
@ -95,4 +95,4 @@ def test_generate_playlist_fallback_if_file_missing(tmp_path: Path):
# Keine Audiodatei anlegen
playlist_path = generate_playlist(album, tmp_path)
content = playlist_path.read_text()
assert "01_Ghost.flac" in content
assert "01_-_Ghost.flac" in content