Fix M3U #EXTINF to include artist: 'Artist - Title' format
#EXTINF:0,Title was missing the artist, causing VLC and other players to show only the track title without the performer. Standard M3U extended format is '#EXTINF:<duration>,<Artist> - <Title>'. Falls back to album.artist when no per-track artist is set. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
97910623c8
commit
9e61b01f92
2 changed files with 3 additions and 2 deletions
|
|
@ -49,7 +49,8 @@ def generate_playlist(album: Album, album_dir: Path) -> Path:
|
|||
filename = f"{track.track_number:02d}_-_{safe_title}.flac"
|
||||
logger.warning("Datei nicht gefunden, Fallback: %s", filename)
|
||||
|
||||
lines.append(f"#EXTINF:0,{track.title}")
|
||||
artist = track.artist or album.artist
|
||||
lines.append(f"#EXTINF:0,{artist} - {track.title}")
|
||||
lines.append(f"{disc_prefix}{filename}")
|
||||
|
||||
playlist_path.write_text("\n".join(lines) + "\n", encoding="utf-8")
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ def test_generate_playlist_extinf_contains_title(tmp_path: Path):
|
|||
(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
|
||||
assert "#EXTINF:0,A - Für Elise" in content
|
||||
|
||||
|
||||
def test_generate_playlist_fallback_if_file_missing(tmp_path: Path):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue