From c85f903caed5bfd74b45f94d48d6336d63c11f58 Mon Sep 17 00:00:00 2001 From: J0J0 T Date: Fri, 4 Mar 2022 08:02:29 +0100 Subject: [PATCH] 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. --- beetsplug/discogs.py | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/beetsplug/discogs.py b/beetsplug/discogs.py index 30aa6d28d..820a0acbd 100644 --- a/beetsplug/discogs.py +++ b/beetsplug/discogs.py @@ -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\d+)\]?$', - r'discogs\.com/release/(?P\d+)-', - r'discogs\.com/[^/]+/release/(?P\d+)', - ]: - match = re.search(pattern, album_id) - if match: - return int(match.group('id')) - else: - return None + for pattern in [ + r'^\[?r?(?P\d+)\]?$', + r'discogs\.com/release/(?P\d+)-', + r'discogs\.com/[^/]+/release/(?P\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