diff --git a/beetsplug/discogs.py b/beetsplug/discogs.py index 875842f83..820a0acbd 100644 --- a/beetsplug/discogs.py +++ b/beetsplug/discogs.py @@ -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. """ diff --git a/docs/changelog.rst b/docs/changelog.rst index 633ddda24..f1833aad4 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -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` diff --git a/test/test_discogs.py b/test/test_discogs.py index d6825c978..c2aa7682c 100644 --- a/test/test_discogs.py +++ b/test/test_discogs.py @@ -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'}