Add ignored setting. Don't show matches with specified penalties applied, e.g. missing tracks or unmatched tracks.

If you know you never want these, they can clutter up the interface
especially now that we have multiple data sources.
This commit is contained in:
Tai Lee 2013-06-03 00:35:32 +10:00
parent 45dc99f1a9
commit f3545860da
4 changed files with 22 additions and 1 deletions

View file

@ -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)

View file

@ -115,3 +115,4 @@ match:
countries: []
media: []
original_year: no
ignored: []

View file

@ -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:

View file

@ -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