diff --git a/beetsplug/discogs.py b/beetsplug/discogs.py index e4c82cd14..69b3746f7 100644 --- a/beetsplug/discogs.py +++ b/beetsplug/discogs.py @@ -303,13 +303,7 @@ class DiscogsPlugin(BeetsPlugin): mediums = [t.medium for t in tracks] country = result.data.get('country') data_url = result.data.get('uri') - style = result.data.get('styles') - if style is None: - self._log.debug('Style not Found') - elif not style: - return style - else: - style = self.config['separator'].as_str().join(sorted(style)) + style = self.format_style(result.data.get('styles')) # Extract information for the optional AlbumInfo fields that are # contained on nested discogs fields. @@ -354,6 +348,15 @@ class DiscogsPlugin(BeetsPlugin): original_day=None, data_source='Discogs', data_url=data_url) + def format_style(self, style): + if style is None: + self._log.debug('Style not Found') + elif not style: + return style + else: + return self.config['separator'].as_str().join(sorted(style)) + + def get_artist(self, artists): """Returns an artist string (all artists) and an artist_id (the main artist) for a list of discogs album or track artists.