diff --git a/beets/autotag/match.py b/beets/autotag/match.py index a44784c07..c2a2372ca 100644 --- a/beets/autotag/match.py +++ b/beets/autotag/match.py @@ -575,8 +575,15 @@ def _add_candidate(items, results, info): # Get the change distance. dist = distance(items, info, mapping) - log.debug('Success. Distance: %f' % dist) + # Skip matches with ignored penalties. + penalties = [key for _, key in dist.sorted] + for penalty in config['match']['ignored'].as_str_seq(): + if penalty in penalties: + log.debug('Ignored. Penalty: %s' % penalty) + return + + log.debug('Success. Distance: %f' % dist) results[info.album_id] = hooks.AlbumMatch(dist, info, mapping, extra_items, extra_tracks) diff --git a/beets/config_default.yaml b/beets/config_default.yaml index 7b9867813..44cb51051 100644 --- a/beets/config_default.yaml +++ b/beets/config_default.yaml @@ -115,3 +115,4 @@ match: countries: [] media: [] original_year: no + ignored: [] diff --git a/docs/changelog.rst b/docs/changelog.rst index 527982190..4076248d0 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -68,6 +68,8 @@ Changelog number is still "correct", just in a different format. * Sort missing and unmatched tracks by index and title and group them together for better readability. + * Don't show potential matches that have specific penalties applied, as + configured by the :ref:`ignored` setting. * Improve calculation of similarity score and recommendation: diff --git a/docs/reference/config.rst b/docs/reference/config.rst index c9f36c5e1..d320cd655 100644 --- a/docs/reference/config.rst +++ b/docs/reference/config.rst @@ -458,6 +458,17 @@ Here's an example:: By default, none of these options are enabled. +.. _ignored: + +ignored +~~~~~~~ + +You can completely avoid matches that have certain penalties applied by adding +the penalty name to the ``ignored`` setting:: + + match: + ignored: missing_tracks unmatched_tracks + .. _path-format-config: Path Format Configuration