Remove tests/ from repo, update .gitignore, improve ripper
- Remove tests/ directory from version control (added to .gitignore) - Add .idea/ to .gitignore - Ripper: CDDB lookup, non-interactive mode, English UI, file renaming - Config: abcde format mapping, per-format quality options - CLI: English help texts, new --no-cddb / --pipes / --parallel / --quality options Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
8ecade5cdc
commit
851dbf3a46
9 changed files with 511 additions and 217 deletions
|
|
@ -1,78 +0,0 @@
|
|||
"""Tests für den Organizer."""
|
||||
|
||||
from pathlib import Path
|
||||
|
||||
from musiksammlung.models import Album, Disc, Track
|
||||
from musiksammlung.organizer import build_mapping, discover_audio_files
|
||||
|
||||
|
||||
def test_discover_audio_files(tmp_path: Path):
|
||||
"""Findet und sortiert Audiodateien korrekt."""
|
||||
(tmp_path / "Track_03.flac").touch()
|
||||
(tmp_path / "Track_01.flac").touch()
|
||||
(tmp_path / "Track_02.flac").touch()
|
||||
(tmp_path / "cover.jpg").touch() # soll ignoriert werden
|
||||
|
||||
files = discover_audio_files(tmp_path)
|
||||
assert len(files) == 3
|
||||
assert files[0].name == "Track_01.flac"
|
||||
assert files[2].name == "Track_03.flac"
|
||||
|
||||
|
||||
def test_build_mapping_single_disc(tmp_path: Path):
|
||||
"""Mapping für ein Single-CD-Album."""
|
||||
(tmp_path / "Track_01.flac").touch()
|
||||
(tmp_path / "Track_02.flac").touch()
|
||||
|
||||
album = Album(
|
||||
artist="TestArtist",
|
||||
album="TestAlbum",
|
||||
year=2000,
|
||||
discs=[
|
||||
Disc(
|
||||
disc_number=1,
|
||||
tracks=[
|
||||
Track(track_number=1, title="Erster Song"),
|
||||
Track(track_number=2, title="Zweiter Song"),
|
||||
],
|
||||
)
|
||||
],
|
||||
)
|
||||
|
||||
output = tmp_path / "output"
|
||||
mapping = build_mapping(album, tmp_path, output)
|
||||
|
||||
assert len(mapping) == 2
|
||||
targets = list(mapping.values())
|
||||
assert targets[0].name == "01 Erster Song.flac"
|
||||
assert targets[1].name == "02 Zweiter Song.flac"
|
||||
# Single-Disc: kein CD1-Unterordner
|
||||
assert "CD1" not in str(targets[0])
|
||||
|
||||
|
||||
def test_build_mapping_multi_disc(tmp_path: Path):
|
||||
"""Mapping für ein Multi-CD-Album."""
|
||||
cd1 = tmp_path / "CD1"
|
||||
cd2 = tmp_path / "CD2"
|
||||
cd1.mkdir()
|
||||
cd2.mkdir()
|
||||
(cd1 / "Track_01.flac").touch()
|
||||
(cd2 / "Track_01.flac").touch()
|
||||
|
||||
album = Album(
|
||||
artist="Artist",
|
||||
album="Box Set",
|
||||
year=1999,
|
||||
discs=[
|
||||
Disc(disc_number=1, tracks=[Track(track_number=1, title="Song A")]),
|
||||
Disc(disc_number=2, tracks=[Track(track_number=1, title="Song B")]),
|
||||
],
|
||||
)
|
||||
|
||||
output = tmp_path / "output"
|
||||
mapping = build_mapping(album, tmp_path, output)
|
||||
|
||||
assert len(mapping) == 2
|
||||
targets = list(mapping.values())
|
||||
assert "CD1" in str(targets[0])
|
||||
assert "CD2" in str(targets[1])
|
||||
Loading…
Add table
Add a link
Reference in a new issue