Skip to content

Commit 9f7e615

Browse files
committed
Deprecate musicbrainz.enabled configuration
1 parent 71bc303 commit 9f7e615

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

beets/ui/__init__.py

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
CLI commands are implemented in the ui.commands module.
1818
"""
1919

20+
from __future__ import annotations
21+
2022
import errno
2123
import optparse
2224
import os.path
@@ -27,7 +29,7 @@
2729
import textwrap
2830
import traceback
2931
from difflib import SequenceMatcher
30-
from typing import Any, Callable
32+
from typing import TYPE_CHECKING, Any, Callable
3133

3234
import confuse
3335

@@ -37,6 +39,9 @@
3739
from beets.util import as_string
3840
from beets.util.functemplate import template
3941

42+
if TYPE_CHECKING:
43+
from types import ModuleType
44+
4045
# On Windows platforms, use colorama to support "ANSI" terminal colors.
4146
if sys.platform == "win32":
4247
try:
@@ -569,7 +574,7 @@ def human_seconds_short(interval):
569574
"text_diff_removed",
570575
"text_diff_changed",
571576
]
572-
COLORS = None
577+
COLORS: dict[str, list[str]] | None = None
573578

574579

575580
def _colorize(color, text):
@@ -1622,7 +1627,9 @@ def parse_subcommand(self, args):
16221627
# The main entry point and bootstrapping.
16231628

16241629

1625-
def _load_plugins(options, config):
1630+
def _load_plugins(
1631+
options: optparse.Values, config: confuse.LazyConfig
1632+
) -> ModuleType:
16261633
"""Load the plugins specified on the command line or in the configuration."""
16271634
paths = config["pluginpath"].as_str_seq(split=False)
16281635
paths = [util.normpath(p) for p in paths]
@@ -1647,6 +1654,11 @@ def _load_plugins(options, config):
16471654
)
16481655
else:
16491656
plugin_list = config["plugins"].as_str_seq()
1657+
# TODO: Remove in v2.4 or v3
1658+
if "musicbrainz" in config and config["musicbrainz"].get().get(
1659+
"enabled"
1660+
):
1661+
plugin_list.append("musicbrainz")
16501662

16511663
# Exclude any plugins that were specified on the command line
16521664
if options.exclude is not None:

docs/changelog.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ New features:
4040
a separate plugin. The default :ref:`plugins-config` includes `musicbrainz`,
4141
but if you've customized your `plugins` list in your configuration, you'll
4242
need to explicitly add `musicbrainz` to continue using this functionality.
43+
Configuration option `musicbrainz.enabled` has thus been deprecated.
4344
:bug:`2686`
4445
:bug:`4605`
4546
* :doc:`plugins/lastgenre`: The new configuration option, ``keep_existing``,

docs/plugins/musicbrainz.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ to one request per second.
7171
enabled
7272
~~~~~~~
7373

74+
.. deprecated:: 2.3
75+
Add `musicbrainz` to the `plugins` list instead.
76+
7477
This option allows you to disable using MusicBrainz as a metadata source. This applies
7578
if you use plugins that fetch data from alternative sources and should make the import
7679
process quicker.

0 commit comments

Comments
 (0)