mirror of
https://github.com/beetbox/beets.git
synced 2026-03-06 21:22:09 +01:00
fix: ftintitle can handle a list of ampersanded artists (#6375)
This was inspired by real life events: https://musicbrainz.org/release/7c4d7a15-6b30-4bef-8b20-af200186fbdb by the artist Danny L Harle has a a track with a featuring list that contains "Danny L Harle, Oklou & MNEK". Before: ``` artist = Danny L Harle, Oklou track = Crystallise My Tears feat. MNEK ``` After: ``` artist = Danny L Harle track = Crystallise My Tears feat. Oklou & MNEK ```
This commit is contained in:
commit
6089ab08fa
3 changed files with 16 additions and 3 deletions
|
|
@ -71,6 +71,12 @@ def split_on_feat(
|
|||
if len(parts) == 2:
|
||||
return parts
|
||||
|
||||
# Try comma as separator
|
||||
# (e.g. "Alice, Bob & Charlie" where Bob and Charlie are featuring)
|
||||
if for_artist and "," in artist:
|
||||
comma_parts = artist.split(",", 1)
|
||||
return comma_parts[0].strip(), comma_parts[1].strip()
|
||||
|
||||
# Fall back to all tokens including generic separators if no explicit match
|
||||
if for_artist:
|
||||
regex = re.compile(
|
||||
|
|
|
|||
|
|
@ -36,9 +36,11 @@ New features
|
|||
3. Comma followed by a space
|
||||
4. Slash wrapped by spaces
|
||||
|
||||
..
|
||||
Bug fixes
|
||||
~~~~~~~~~
|
||||
Bug fixes
|
||||
~~~~~~~~~
|
||||
|
||||
- :doc:`plugins/ftintitle`: Fix handling of multiple featured artists with
|
||||
ampersand.
|
||||
|
||||
For plugin developers
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
|
|
|
|||
|
|
@ -324,6 +324,11 @@ def test_find_feat_part(
|
|||
("Alice feat. Bob", ("Alice", "Bob")),
|
||||
("Alice featuring Bob", ("Alice", "Bob")),
|
||||
("Alice & Bob", ("Alice", "Bob")),
|
||||
("Alice, Bob & Charlie", ("Alice", "Bob & Charlie")),
|
||||
(
|
||||
"Alice, Bob & Charlie feat. Xavier",
|
||||
("Alice, Bob & Charlie", "Xavier"),
|
||||
),
|
||||
("Alice and Bob", ("Alice", "Bob")),
|
||||
("Alice With Bob", ("Alice", "Bob")),
|
||||
("Alice defeat Bob", ("Alice defeat Bob", None)),
|
||||
|
|
|
|||
Loading…
Reference in a new issue