diff --git a/beetsplug/discogs.py b/beetsplug/discogs.py index f025c9775..cea7a9b0c 100644 --- a/beetsplug/discogs.py +++ b/beetsplug/discogs.py @@ -196,7 +196,7 @@ class DiscogsPlugin(BeetsPlugin): """ 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'] @@ -205,7 +205,7 @@ class DiscogsPlugin(BeetsPlugin): # 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 diff --git a/docs/changelog.rst b/docs/changelog.rst index 1f1221543..533a7e348 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -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)