From e35c767e2c935b392e7ca70419fe2c1861a7fa76 Mon Sep 17 00:00:00 2001 From: J0J0 T Date: Sun, 9 Jan 2022 14:29:47 +0100 Subject: [PATCH] Skip Discogs query on insufficiently tagged files - When files are missing both, album and artist tags, the Discogs metadata plugin sends empty information to the Discogs API which returns arbitrary query results. - This patch catches this case and states it in beets import verbose output. --- beetsplug/discogs.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/beetsplug/discogs.py b/beetsplug/discogs.py index d015e4201..8c950c521 100644 --- a/beetsplug/discogs.py +++ b/beetsplug/discogs.py @@ -157,6 +157,11 @@ class DiscogsPlugin(BeetsPlugin): if not self.discogs_client: return + if not album and not artist: + self._log.debug('Skipping Discogs query. Files missing album and ' + 'artist tags.') + return [] + if va_likely: query = album else: