fix: scan populates each followed artist's full discography (unmonitored)

A followed artist previously showed only the one owned album ("of 1")
because scan_library recorded just the resolved release. Now scan
browses each artist's full MusicBrainz release-group list once per
run and stores it as unmonitored MonitoredRelease rows, matching
web-follow behavior. The owned album keeps its monitored/fulfilled
state via ON CONFLICT DO NOTHING.
This commit is contained in:
Jonathan
2026-07-11 17:49:26 +02:00
parent 2fb825140f
commit aafd8b15d5
4 changed files with 81 additions and 29 deletions
+2 -1
View File
@@ -1,3 +1,4 @@
from lyra_worker.adapters.fakes import FakeMbBrowser
from lyra_worker.main import _run_scan
from lyra_worker.types import MBTarget
@@ -35,7 +36,7 @@ def test_run_scan_writes_result_and_clears_flag(conn, tmp_path):
(tmp_path / "John Mayer" / "Continuum (2006)" / "01.flac").write_bytes(b"")
_set(conn, "scan.requested", "true")
_run_scan(conn, FakeResolver(), FakeProbe(), dest_root=str(tmp_path))
_run_scan(conn, FakeResolver(), FakeProbe(), FakeMbBrowser(), dest_root=str(tmp_path))
assert _get(conn, "scan.requested") == "false" # flag cleared
assert "imported" in (_get(conn, "scan.result") or "") # summary written