Fix a bug in ftintitle with the order of album artist

There was a bug in the find_feat_part function that would cause it to
fail if the album artist was the second part of the featured string.

For example, if the Artist field was Alice & Bob, and the Album Artist
field was Bob it would return None due to the order.

This fixes that and adds test cases to ensure it doesn't return.
This commit is contained in:
Marc Addeo 2014-12-28 20:20:29 -05:00
parent 4d4113e3a4
commit a70820d8a1
2 changed files with 3 additions and 1 deletions

View file

@ -95,7 +95,7 @@ def find_feat_part(artist, albumartist):
# featuring artist on the left-hand side.
else:
lhs, rhs = split_on_feat(albumartist_split[0])
if rhs:
if lhs:
feat_part = lhs
return feat_part

View file

@ -32,6 +32,8 @@ class FtInTitlePluginTest(unittest.TestCase):
{'artist': 'Alice and Bob', 'album_artist': 'Alice', 'feat_part': 'Bob'},
{'artist': 'Alice With Bob', 'album_artist': 'Alice', 'feat_part': 'Bob'},
{'artist': 'Alice defeat Bob', 'album_artist': 'Alice', 'feat_part': None},
{'artist': 'Alice & Bob', 'album_artist': 'Bob', 'feat_part': 'Alice'},
{'artist': 'Alice ft. Bob', 'album_artist': 'Bob', 'feat_part': 'Alice'},
]
for test_case in test_cases: