Skip to content

Commit

Permalink
discogs: Fix #1049: intermittent trailing comma
Browse files Browse the repository at this point in the history
  • Loading branch information
sampsyo committed Oct 30, 2014
1 parent 69b7d1f commit 50c7cf0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions beetsplug/discogs.py
Expand Up @@ -196,7 +196,7 @@ def get_artist(self, artists):
"""
artist_id = None
bits = []
for artist in artists:
for i, artist in enumerate(artists):
if not artist_id:
artist_id = artist['id']
name = artist['name']
Expand All @@ -205,7 +205,7 @@ def get_artist(self, artists):
# Move articles to the front.
name = re.sub(r'(?i)^(.*?), (a|an|the)$', r'\2 \1', name)
bits.append(name)
if artist['join']:
if artist['join'] and i < len(artists) - 1:
bits.append(artist['join'])
artist = ' '.join(bits).replace(' ,', ',') or None
return artist, artist_id
Expand Down
2 changes: 2 additions & 0 deletions docs/changelog.rst
Expand Up @@ -66,6 +66,8 @@ Fixes:
* :doc:`/plugins/embedart`: Avoid resizing the image multiple times when
embedding into an album. Thanks to :user:`kerobaros`. :bug:`1028`,
:bug:`1036`
* :doc:`/plugins/discogs`: Avoid a situation where a trailing comma could be
appended to some artist names. :bug:`1049`


1.3.8 (September 17, 2014)
Expand Down

0 comments on commit 50c7cf0

Please sign in to comment.