mirror of
https://github.com/beetbox/beets.git
synced 2025-12-12 03:24:44 +01:00
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:
parent
b609047d64
commit
c85f903cae
1 changed files with 10 additions and 11 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue