feat(lidarr): add Artist - Track query splitter

This commit is contained in:
2026-06-08 21:08:02 -07:00
parent 45121dd807
commit b0e3ce6e6c
2 changed files with 27 additions and 0 deletions

View File

@@ -0,0 +1,18 @@
import server.mf # noqa: F401 — loads musicfetch, registers musicfetch_core in sys.modules
import musicfetch_core as mf
def test_split_query_with_dash():
assert mf._split_query("Daft Punk - Discovery") == ("Daft Punk", "Discovery")
def test_split_query_no_dash():
assert mf._split_query("Daft Punk") == ("Daft Punk", None)
def test_split_query_splits_on_first_dash_only():
assert mf._split_query("A - B - C") == ("A", "B - C")
def test_split_query_strips_whitespace():
assert mf._split_query(" Daft Punk - Discovery ") == ("Daft Punk", "Discovery")