fix: write single first-artist tag, not doubled/multi-artist
Live end-to-end test surfaced two bugs in youtube tagging: - `--replace-in-metadata artist .* NAME` matched twice and doubled the artist tag (e.g. "SLVMLORDSLVMLORD"). Anchor with ^.*$ to match once. - Use only the first artist when several are present (SLVMLORD, not "SLVMLORD, Travis Bradley, ...") for both the embedded tag and the spoken/echoed API messages. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -28,6 +28,17 @@ def test_done_message_mentions_title():
|
||||
assert "Avril Lavigne" in msg
|
||||
|
||||
|
||||
def test_messages_use_only_first_artist():
|
||||
hit = mf.Hit(source="youtube", kind="track", title="Under My Skin",
|
||||
artist="SLVMLORD, James John, BobbyGee", album="X", year="",
|
||||
payload={"videoId": "abc"})
|
||||
for msg in (actions.started_message(hit), actions.done_message(hit),
|
||||
actions.failed_message(hit)):
|
||||
assert "SLVMLORD" in msg
|
||||
assert "James John" not in msg
|
||||
assert "BobbyGee" not in msg
|
||||
|
||||
|
||||
def test_perform_youtube_calls_act_youtube(monkeypatch):
|
||||
calls = {}
|
||||
monkeypatch.setattr(mf, "act_youtube",
|
||||
|
||||
Reference in New Issue
Block a user