4907d0d5a4
Adds the AudioProbe seam (probe.py, _probe.py MutagenProbe with a lazy mutagen import, FakeAudioProbe) and scan_library, which walks /music, resolves each album against MusicBrainz (falling back to embedded tags when the folder name doesn't resolve), and idempotently records matched albums as have (LibraryItem), monitored (MonitoredRelease, fulfilled), and followed (WatchedArtist, autoMonitorFuture=false). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
17 lines
456 B
Python
17 lines
456 B
Python
import os
|
|
|
|
import pytest
|
|
|
|
pytestmark = pytest.mark.skipif(
|
|
not (os.environ.get("LYRA_LIVE_TESTS") and os.environ.get("LYRA_SAMPLE_AUDIO")),
|
|
reason="reads a real audio file; set LYRA_LIVE_TESTS=1 + LYRA_SAMPLE_AUDIO=/path/to/a.flac to run",
|
|
)
|
|
|
|
|
|
def test_probe_reads_a_real_file():
|
|
from lyra_worker._probe import MutagenProbe
|
|
|
|
r = MutagenProbe().probe(os.environ["LYRA_SAMPLE_AUDIO"])
|
|
assert r.quality_class in (1, 2, 3)
|
|
assert r.fmt
|