diff --git a/beetsplug/ftintitle.py b/beetsplug/ftintitle.py index 2fb024458..74d9d7ed0 100644 --- a/beetsplug/ftintitle.py +++ b/beetsplug/ftintitle.py @@ -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 diff --git a/test/plugins/test_ftintitle.py b/test/plugins/test_ftintitle.py index f5782bd0d..cb71fddc6 100644 --- a/test/plugins/test_ftintitle.py +++ b/test/plugins/test_ftintitle.py @@ -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(