mirror of
https://github.com/beetbox/beets.git
synced 2025-12-24 17:43:52 +01:00
Merge pull request #4319 from snejus/disable-musicbrainz-plugin
Ability to optionally disable the musicbrainz metadata source
This commit is contained in:
commit
6e142efbb2
4 changed files with 34 additions and 21 deletions
|
|
@ -598,6 +598,14 @@ def tracks_for_id(track_id):
|
|||
yield t
|
||||
|
||||
|
||||
def invoke_mb(call_func, *args):
|
||||
try:
|
||||
return call_func(*args)
|
||||
except mb.MusicBrainzAPIError as exc:
|
||||
exc.log(log)
|
||||
return ()
|
||||
|
||||
|
||||
@plugins.notify_info_yielded('albuminfo_received')
|
||||
def album_candidates(items, artist, album, va_likely, extra_tags):
|
||||
"""Search for album matches. ``items`` is a list of Item objects
|
||||
|
|
@ -609,25 +617,19 @@ def album_candidates(items, artist, album, va_likely, extra_tags):
|
|||
constrain the search.
|
||||
"""
|
||||
|
||||
# Base candidates if we have album and artist to match.
|
||||
if artist and album:
|
||||
try:
|
||||
yield from mb.match_album(artist, album, len(items),
|
||||
extra_tags)
|
||||
except mb.MusicBrainzAPIError as exc:
|
||||
exc.log(log)
|
||||
if config["musicbrainz"]["enabled"]:
|
||||
# Base candidates if we have album and artist to match.
|
||||
if artist and album:
|
||||
yield from invoke_mb(mb.match_album, artist, album, len(items),
|
||||
extra_tags)
|
||||
|
||||
# Also add VA matches from MusicBrainz where appropriate.
|
||||
if va_likely and album:
|
||||
try:
|
||||
yield from mb.match_album(None, album, len(items),
|
||||
extra_tags)
|
||||
except mb.MusicBrainzAPIError as exc:
|
||||
exc.log(log)
|
||||
# Also add VA matches from MusicBrainz where appropriate.
|
||||
if va_likely and album:
|
||||
yield from invoke_mb(mb.match_album, None, album, len(items),
|
||||
extra_tags)
|
||||
|
||||
# Candidates from plugins.
|
||||
yield from plugins.candidates(items, artist, album, va_likely,
|
||||
extra_tags)
|
||||
yield from plugins.candidates(items, artist, album, va_likely, extra_tags)
|
||||
|
||||
|
||||
@plugins.notify_info_yielded('trackinfo_received')
|
||||
|
|
@ -638,11 +640,8 @@ def item_candidates(item, artist, title):
|
|||
"""
|
||||
|
||||
# MusicBrainz candidates.
|
||||
if artist and title:
|
||||
try:
|
||||
yield from mb.match_track(artist, title)
|
||||
except mb.MusicBrainzAPIError as exc:
|
||||
exc.log(log)
|
||||
if config["musicbrainz"]["enabled"] and artist and title:
|
||||
yield from invoke_mb(mb.match_track, artist, title)
|
||||
|
||||
# Plugin candidates.
|
||||
yield from plugins.item_candidates(item, artist, title)
|
||||
|
|
|
|||
|
|
@ -101,6 +101,7 @@ paths:
|
|||
statefile: state.pickle
|
||||
|
||||
musicbrainz:
|
||||
enabled: yes
|
||||
host: musicbrainz.org
|
||||
https: no
|
||||
ratelimit: 1
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@ Changelog goes here!
|
|||
|
||||
New features:
|
||||
|
||||
* :ref:`musicbrainz-config`: a new :ref:`musicbrainz.enabled` option allows disabling
|
||||
the MusicBrainz metadata source during the autotagging process
|
||||
* :doc:`/plugins/kodiupdate`: Now supports multiple kodi instances
|
||||
:bug:`4101`
|
||||
* Add the item fields ``bitrate_mode``, ``encoder_info`` and ``encoder_settings``.
|
||||
|
|
|
|||
|
|
@ -741,6 +741,17 @@ to one request per second.
|
|||
.. _limited: https://musicbrainz.org/doc/XML_Web_Service/Rate_Limiting
|
||||
.. _Building search indexes: https://musicbrainz.org/doc/Development/Search_server_setup
|
||||
|
||||
.. _musicbrainz.enabled:
|
||||
|
||||
enabled
|
||||
~~~~~~~
|
||||
|
||||
This option allows you to disable using MusicBrainz as a metadata source. This applies
|
||||
if you use plugins that fetch data from alternative sources and should make the import
|
||||
process quicker.
|
||||
|
||||
Default: ``yes``.
|
||||
|
||||
.. _searchlimit:
|
||||
|
||||
searchlimit
|
||||
|
|
|
|||
Loading…
Reference in a new issue