mirror of
https://github.com/beetbox/beets.git
synced 2026-07-16 14:07:40 -04:00
fix(ftintitle): remove singleton handling as out of scope
This commit is contained in:
@@ -117,20 +117,14 @@ def find_feat_part(
|
||||
"""Attempt to find featured artists in the item's artist fields and
|
||||
return the results. Returns None if no featured artist found.
|
||||
"""
|
||||
if not albumartist:
|
||||
_, feat_part = split_on_feat(
|
||||
artist, for_artist=True, custom_words=custom_words
|
||||
)
|
||||
return feat_part
|
||||
|
||||
# If the album artist is featured, move the remaining artist to the title.
|
||||
artist_part, feat_part = split_on_feat(artist, custom_words=custom_words)
|
||||
if feat_part == albumartist and artist_part:
|
||||
if albumartist and feat_part == albumartist and artist_part:
|
||||
return artist_part
|
||||
|
||||
# Handle a wider variety of extraction cases if the album artist is
|
||||
# contained within the track artist.
|
||||
if albumartist in artist:
|
||||
if albumartist and albumartist in artist:
|
||||
albumartist_split = artist.split(albumartist, 1)
|
||||
|
||||
# If the last element of the split (the right-hand side of the
|
||||
|
||||
@@ -281,14 +281,6 @@ class TestFtInTitlePluginFunctional(PluginTestHelper):
|
||||
"Song",
|
||||
id="no-feature",
|
||||
),
|
||||
pytest.param(
|
||||
{"auto": True},
|
||||
"Alice & Bob",
|
||||
"Song",
|
||||
"Alice",
|
||||
"Song feat. Bob",
|
||||
id="generic-separator-singleton",
|
||||
),
|
||||
pytest.param(
|
||||
{"auto": True},
|
||||
"Alice feat. Bob",
|
||||
@@ -434,7 +426,6 @@ class TestFtInTitlePluginFunctional(PluginTestHelper):
|
||||
("Alice & Bob", "Bob", "Alice"),
|
||||
("Alice ft. Bob", "Bob", "Alice"),
|
||||
("Alice ft. Carol", "Bob", "Carol"),
|
||||
("Alice & Bob", "", "Bob"),
|
||||
],
|
||||
)
|
||||
def test_find_feat_part(
|
||||
|
||||
Reference in New Issue
Block a user