From ffe63a64f5dc6724054e22dd88d4181068c5f4e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0ar=C5=ABnas=20Nejus?= Date: Sun, 13 Mar 2022 18:50:22 +0000 Subject: [PATCH] Nicely disable musicbrainz --- beets/autotag/mb.py | 9 +++++++++ beets/config_default.yaml | 1 + 2 files changed, 10 insertions(+) diff --git a/beets/autotag/mb.py b/beets/autotag/mb.py index e6a2e277f..9a6a7e7f9 100644 --- a/beets/autotag/mb.py +++ b/beets/autotag/mb.py @@ -482,6 +482,9 @@ def match_album(artist, album, tracks=None, extra_tags=None): The query consists of an artist name, an album name, and, optionally, a number of tracks on the album and any other extra tags. """ + if not config["musicbrainz"]["enabled"].get(bool): + return None + # Build search criteria. criteria = {'release': album.lower().strip()} if artist is not None: @@ -558,6 +561,9 @@ def album_for_id(releaseid): object or None if the album is not found. May raise a MusicBrainzAPIError. """ + if not config["musicbrainz"]["enabled"].get(bool): + return None + log.debug('Requesting MusicBrainz release {}', releaseid) albumid = _parse_id(releaseid) if not albumid: @@ -579,6 +585,9 @@ def track_for_id(releaseid): """Fetches a track by its MusicBrainz ID. Returns a TrackInfo object or None if no track is found. May raise a MusicBrainzAPIError. """ + if not config["musicbrainz"]["enabled"].get(bool): + return None + trackid = _parse_id(releaseid) if not trackid: log.debug('Invalid MBID ({0}).', releaseid) diff --git a/beets/config_default.yaml b/beets/config_default.yaml index 74540891e..518e086a1 100644 --- a/beets/config_default.yaml +++ b/beets/config_default.yaml @@ -108,6 +108,7 @@ musicbrainz: searchlimit: 5 extra_tags: [] genres: no + enabled: yes match: strong_rec_thresh: 0.04