Add project skeleton: CLI pipeline for CD digitization

Modular Python package with Typer CLI (scan/apply/process commands),
Pydantic data models, OCR via Tesseract, LLM-based tracklist parsing,
mutagen audio tagging, M3U playlist generation, and cover processing.
Includes 8 passing tests and ruff lint config.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Dieter Schlüter 2026-02-15 00:47:54 +01:00
commit 3e073250ca
17 changed files with 1027 additions and 0 deletions

37
tests/test_playlist.py Normal file
View file

@ -0,0 +1,37 @@
"""Tests für die Playlist-Generierung."""
from pathlib import Path
from musiksammlung.models import Album, Disc, Track
from musiksammlung.playlist import generate_playlist
def test_generate_playlist_single_disc(tmp_path: Path):
"""Erzeugt eine M3U-Playlist für ein Single-CD-Album."""
album = Album(
artist="Artist",
album="TestAlbum",
year=2000,
discs=[
Disc(
disc_number=1,
tracks=[
Track(track_number=1, title="Song Eins"),
Track(track_number=2, title="Song Zwei"),
],
)
],
)
# Dummy-Audiodateien anlegen
(tmp_path / "01 Song Eins.flac").touch()
(tmp_path / "02 Song Zwei.flac").touch()
playlist_path = generate_playlist(album, tmp_path)
assert playlist_path.exists()
content = playlist_path.read_text()
assert "#EXTM3U" in content
assert "01 Song Eins.flac" in content
assert "02 Song Zwei.flac" in content
# Kein CD-Prefix bei Single-Disc
assert "CD1/" not in content