mirror of
https://github.com/beetbox/beets.git
synced 2026-02-13 10:51:59 +01:00
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:
parent
4d4113e3a4
commit
a70820d8a1
2 changed files with 3 additions and 1 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
Loading…
Reference in a new issue