Merge pull request #4303 from JOJ0/master

discogs: Fix discogs_albumid extraction
This commit is contained in:
Adrian Sampson 2022-03-04 21:07:50 +01:00 committed by GitHub
commit 80a86c62b7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 7 deletions

View file

@ -326,7 +326,7 @@ class DiscogsPlugin(BeetsPlugin):
else:
genre = base_genre
discogs_albumid = self.extract_release_id(result.data.get('uri'))
discogs_albumid = self.extract_release_id_regex(result.data.get('uri'))
# Extract information for the optional AlbumInfo fields that are
# contained on nested discogs fields.
@ -378,12 +378,6 @@ class DiscogsPlugin(BeetsPlugin):
else:
return None
def extract_release_id(self, uri):
if uri:
return uri.split("/")[-1]
else:
return None
def get_tracks(self, tracklist):
"""Returns a list of TrackInfo objects for a discogs tracklist.
"""

View file

@ -16,6 +16,10 @@ New features:
Bug fixes:
* The Discogs release ID is now populated correctly to the discogs_albumid
field again (it was no longer working after Discogs changed their release URL
format).
:bug:`4225`
* The autotagger no longer considers all matches without a MusicBrainz ID as
duplicates of each other.
:bug:`4299`

View file

@ -337,6 +337,7 @@ class DGAlbumInfoTest(_common.TestCase):
def test_parse_minimal_release(self):
"""Test parsing of a release with the minimal amount of information."""
data = {'id': 123,
'uri': 'https://www.discogs.com/release/123456-something',
'tracklist': [self._make_track('A', '1', '01:01')],
'artists': [{'name': 'ARTIST NAME', 'id': 321, 'join': ''}],
'title': 'TITLE'}