From a99eb773373dd6816e566c03fe409012d1cb436a Mon Sep 17 00:00:00 2001 From: ghbrown Date: Fri, 20 Jan 2023 22:15:50 -0600 Subject: [PATCH] Improve where an how data added to tracks of album --- beetsplug/discogs.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/beetsplug/discogs.py b/beetsplug/discogs.py index 44601e7e9..103aa1107 100644 --- a/beetsplug/discogs.py +++ b/beetsplug/discogs.py @@ -215,8 +215,6 @@ class DiscogsPlugin(BeetsPlugin): for album_cur in albums: self._log.debug(u'searching within album {0}', album_cur.album) candidates += album_cur.tracks - for candidate in candidates: - candidate.data_source = 'Discogs' # first 10 results, don't overwhelm with options return candidates[:10] @@ -391,13 +389,15 @@ class DiscogsPlugin(BeetsPlugin): for track in tracks: track.media = media track.medium_total = mediums.count(track.medium) - # artist info will be identical for all tracks until #3353 fixed - track.artist = artist - track.artist_id = artist_id + if not track.artist: # get_track_info often fails to find artist + track.artist = artist + if not track.artist_id: + track.artist_id = artist_id # Discogs does not have track IDs. Invent our own IDs as proposed # in #2336. track.track_id = str(album_id) + "-" + track.track_alt track.data_url = data_url + track.data_source = 'Discogs' # Retrieve master release id (returns None if there isn't one). master_id = result.data.get('master_id')