mirror of
https://github.com/beetbox/beets.git
synced 2025-12-06 08:39:17 +01:00
Warn users of deprecated musicbrainz.enabled option
This commit is contained in:
parent
9f7cb8dbe4
commit
3bb068a675
2 changed files with 11 additions and 6 deletions
|
|
@ -415,16 +415,19 @@ def get_plugin_names() -> list[str]:
|
|||
sys.path += paths
|
||||
plugins = unique_list(beets.config["plugins"].as_str_seq())
|
||||
# TODO: Remove in v3.0.0
|
||||
if (
|
||||
"musicbrainz" not in plugins
|
||||
and beets.config["musicbrainz"].flatten().get("enabled") is not False
|
||||
):
|
||||
if "musicbrainz" not in plugins:
|
||||
deprecate_for_user(
|
||||
log,
|
||||
"Automatic loading of 'musicbrainz' plugin",
|
||||
"'plugins' configuration to explicitly add 'musicbrainz'",
|
||||
)
|
||||
plugins.append("musicbrainz")
|
||||
enabled = beets.config["musicbrainz"].flatten().get("enabled")
|
||||
if enabled is not None:
|
||||
deprecate_for_user(
|
||||
log, "'musicbrainz.enabled' configuration option"
|
||||
)
|
||||
if enabled is not False:
|
||||
plugins.append("musicbrainz")
|
||||
|
||||
beets.config.add({"disabled_plugins": []})
|
||||
disabled_plugins = set(beets.config["disabled_plugins"].as_str_seq())
|
||||
|
|
|
|||
|
|
@ -21,7 +21,9 @@ def _format_message(old: str, new: str | None = None) -> str:
|
|||
return msg
|
||||
|
||||
|
||||
def deprecate_for_user(logger: Logger, old: str, new: str) -> None:
|
||||
def deprecate_for_user(
|
||||
logger: Logger, old: str, new: str | None = None
|
||||
) -> None:
|
||||
logger.warning(_format_message(old, new))
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue