discogs: don't crash if a release is deleted

This commit is contained in:
Rebecca Turner 2025-07-24 20:47:01 -04:00
parent 5beb3d1c81
commit 0430bd383a
2 changed files with 10 additions and 1 deletions

View file

@ -305,7 +305,14 @@ class DiscogsPlugin(MetadataSourcePlugin):
# Explicitly reload the `Release` fields, as they might not be yet
# present if the result is from a `discogs_client.search()`.
if not result.data.get("artists"):
result.refresh()
try:
result.refresh()
except CONNECTION_ERRORS:
self._log.debug(
"Connection error in release lookup: {0}",
result,
)
return None
# Sanity check for required fields. The list of required fields is
# defined at Guideline 1.3.1.a, but in practice some releases might be

View file

@ -55,6 +55,8 @@ Bug fixes:
e.g. non latin characters as 盗作. If you want to keep the legacy behavior
set the config option ``spotify.search_query_ascii: yes``.
:bug:`5699`
* :doc:`plugins/discogs`: Beets will no longer crash if a release has been
deleted, and returns a 404.
For packagers: