From ade9978f7e2fc923d47a40b2180cc3b6065eb491 Mon Sep 17 00:00:00 2001 From: Andrew Rogl Date: Sat, 2 Oct 2021 21:39:26 +1000 Subject: [PATCH] Updated after feedback from @wisp3rwind --- beetsplug/discogs.py | 9 ++++----- docs/changelog.rst | 2 +- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/beetsplug/discogs.py b/beetsplug/discogs.py index 9f9c3ef76..f9c37c59c 100644 --- a/beetsplug/discogs.py +++ b/beetsplug/discogs.py @@ -206,13 +206,12 @@ class DiscogsPlugin(BeetsPlugin): self._log.debug('Searching for release {0}', album_id) # Discogs-IDs are simple integers. We only look for those at the end - # of an input string as to avoid confusion with other metadata plugins. + # of an input string or after the "/release/" keyword as to avoid + # confusion with other metadata plugins. # An optional bracket can follow the integer, as this is how discogs # displays the release ID on its webpage. - # Issue #4080 highlighted that Discogs changed the way the URL - # is formed - match = re.search(r'(^|[*r|discogs\.com/.+/release/])(\d+)($|)', - album_id) + match = re.search( + r"(^|\[*r|discogs\.com.*/release/)(\d+)(|\])", album_id) if not match: return None diff --git a/docs/changelog.rst b/docs/changelog.rst index 519ecae43..8bad04728 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -39,7 +39,7 @@ Bug fixes: * :doc:`/plugins/lyrics`: Fix crash bug when beautifulsoup4 is not installed. :bug:`4027` -* :doc:`/plugins/discogs`: Fix regex for new style of regex. +* :doc:`/plugins/discogs`: Adapt regex to new URL format . :bug: `4080` 1.5.0 (August 19, 2021)