diff --git a/beetsplug/discogs.py b/beetsplug/discogs.py index 3b2595585..b1b1593cd 100644 --- a/beetsplug/discogs.py +++ b/beetsplug/discogs.py @@ -505,6 +505,12 @@ class DiscogsPlugin(BeetsPlugin): for subtrack in subtracks: if not subtrack.get('artists'): subtrack['artists'] = index_track['artists'] + # Concatenate index with track title when index_tracks + # option is set + if self.config['index_tracks']: + for subtrack in subtracks: + subtrack['title'] = '{}: {}'.format( + index_track['title'], subtrack['title']) tracklist.extend(subtracks) else: # Merge the subtracks, pick a title, and append the new track. @@ -557,7 +563,8 @@ class DiscogsPlugin(BeetsPlugin): title = track['title'] if self.config['index_tracks']: prefix = ', '.join(divisions) - title = ': '.join([prefix, title]) + if prefix: + title = '{}: {}'.format(prefix, title) track_id = None medium, medium_index, _ = self.get_track_index(track['position']) artist, artist_id = MetadataSourcePlugin.get_artist( diff --git a/docs/changelog.rst b/docs/changelog.rst index b73320756..ce445496e 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -176,6 +176,9 @@ New features: Fixes: +* :bug:`/plugins/discogs`: Fixed a bug with ``index_tracks`` options that + sometimes caused the index to be discarded. Also remove the extra semicolon + that was added when there is no index track. * :doc:`/plugins/subsonicupdate`: REST was using `POST` method rather `GET` method. Also includes better exception handling, response parsing, and tests. * :doc:`/plugins/the`: Fixed incorrect regex for 'the' that matched any