diff --git a/beets/autotag/match.py b/beets/autotag/match.py index 4530fc55b..832189a94 100644 --- a/beets/autotag/match.py +++ b/beets/autotag/match.py @@ -350,7 +350,6 @@ def _recommendation(results): return rec - def _add_candidate(items, results, info): """Given a candidate AlbumInfo object, attempt to add the candidate to the output dictionary of AlbumMatch objects. This involves @@ -363,6 +362,12 @@ def _add_candidate(items, results, info): if info.album_id in results: log.debug('Duplicate.') return + + # Discard matches without required tags. + for req_tag in config['match']['required'].as_str_seq(): + if getattr(info, req_tag) is None: + log.debug('Ignored. Missing required tag: %s' % req_tag) + return # Find mapping between the items and the track info. mapping, extra_items, extra_tracks = assign_items(items, info.tracks)