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)