mirror of
https://github.com/beetbox/beets.git
synced 2025-12-14 12:35:19 +01:00
Discard matches without required tags
Skip a match that doesn't have any of the config-defined tags I want to enforce.
This commit is contained in:
parent
e77814fa48
commit
6dbb60373f
1 changed files with 6 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue