mirror of
https://github.com/beetbox/beets.git
synced 2025-12-15 04:55:10 +01:00
Add ability to specify a maximum recommendation for Discogs matches.
This commit is contained in:
parent
34faebfbdb
commit
15be24998a
4 changed files with 25 additions and 5 deletions
|
|
@ -357,7 +357,7 @@ def _recommendation(results):
|
|||
if isinstance(results[0], hooks.AlbumMatch):
|
||||
# Load the configured recommendation maxima.
|
||||
max_rec = {}
|
||||
for trigger in 'partial', 'tracklength', 'tracknumber':
|
||||
for trigger in 'discogs', 'partial', 'tracklength', 'tracknumber':
|
||||
max_rec[trigger] = \
|
||||
config['match']['max_rec'][trigger].as_choice({
|
||||
'strong': recommendation.strong,
|
||||
|
|
@ -366,6 +366,11 @@ def _recommendation(results):
|
|||
'none': recommendation.none,
|
||||
})
|
||||
|
||||
# Discogs.
|
||||
if rec > max_rec['discogs'] and \
|
||||
results[0].info.data_source == 'Discogs':
|
||||
rec = max_rec['discogs']
|
||||
|
||||
# Partial match.
|
||||
if rec > max_rec['partial'] and \
|
||||
(results[0].extra_items or results[0].extra_tracks):
|
||||
|
|
|
|||
|
|
@ -68,6 +68,7 @@ match:
|
|||
medium_rec_thresh: 0.25
|
||||
rec_gap_thresh: 0.25
|
||||
max_rec:
|
||||
discogs: strong
|
||||
partial: medium
|
||||
tracklength: strong
|
||||
tracknumber: strong
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ Changelog
|
|||
that go missing.
|
||||
* More consistent display and colorization of album and track metadata.
|
||||
|
||||
.. _discogs: http://discogs.com/
|
||||
.. _Discogs: http://discogs.com/
|
||||
|
||||
1.1.0 (April 29, 203)
|
||||
---------------------
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ Discogs Plugin
|
|||
The ``discogs`` plugin extends the autotagger's search capabilities to
|
||||
include matches from the `Discogs`_ database.
|
||||
|
||||
.. _discogs: http://discogs.com
|
||||
.. _Discogs: http://discogs.com
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
|
@ -14,7 +14,21 @@ install the `discogs-client`_ library by typing::
|
|||
|
||||
pip install discogs-client
|
||||
|
||||
That's it! Matches from Discogs will now show up during import alongside
|
||||
matches from MusicBrainz.
|
||||
Matches from Discogs will now show up during import alongside matches from
|
||||
MusicBrainz.
|
||||
|
||||
.. _discogs-client: https://github.com/discogs/discogs_client
|
||||
|
||||
Configuration
|
||||
-------------
|
||||
|
||||
You can use the :ref:`max_rec` setting to define a maximum recommendation level
|
||||
for matches from Discogs::
|
||||
|
||||
match:
|
||||
max_rec:
|
||||
discogs: medium
|
||||
|
||||
This example would prevent the auto-tagger from automatically applying a
|
||||
strong match from Discogs, and give you a chance to confirm the changes. The
|
||||
default is ``strong``.
|
||||
|
|
|
|||
Loading…
Reference in a new issue