Revert "discogs: Add extract_release_id_regex sanity check"

This reverts commit c3cc055fdd3830bbe1c5470fe540684278a6ecc7.

We assume the Discogs API never returns a release response without an
URI.
This commit is contained in:
J0J0 T 2022-03-04 08:02:29 +01:00
parent b609047d64
commit c85f903cae

View file

@ -194,17 +194,16 @@ class DiscogsPlugin(BeetsPlugin):
# patterns.
# Regex has been tested here https://regex101.com/r/wyLdB4/2
if album_id:
for pattern in [
r'^\[?r?(?P<id>\d+)\]?$',
r'discogs\.com/release/(?P<id>\d+)-',
r'discogs\.com/[^/]+/release/(?P<id>\d+)',
]:
match = re.search(pattern, album_id)
if match:
return int(match.group('id'))
else:
return None
for pattern in [
r'^\[?r?(?P<id>\d+)\]?$',
r'discogs\.com/release/(?P<id>\d+)-',
r'discogs\.com/[^/]+/release/(?P<id>\d+)',
]:
match = re.search(pattern, album_id)
if match:
return int(match.group('id'))
return None
def album_for_id(self, album_id):
"""Fetches an album by its Discogs ID and returns an AlbumInfo object