From 5cd6a39a01167361c3fef4c1670cdef1e573ebc7 Mon Sep 17 00:00:00 2001 From: Sebastian Mohr Date: Wed, 9 Jul 2025 10:33:52 +0200 Subject: [PATCH] Edited changelog and fixed an issue with plugin loading. --- beets/plugins.py | 2 ++ docs/changelog.rst | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/beets/plugins.py b/beets/plugins.py index c0d71bec1..8d1f5e93a 100644 --- a/beets/plugins.py +++ b/beets/plugins.py @@ -23,6 +23,7 @@ import sys import traceback from collections import defaultdict from functools import wraps +from types import GenericAlias from typing import TYPE_CHECKING, Any, Callable, Sequence, TypeVar import mediafile @@ -298,6 +299,7 @@ def load_plugins(names: Sequence[str] = ()) -> None: for obj in getattr(namespace, name).__dict__.values(): if ( inspect.isclass(obj) + and not isinstance(obj, GenericAlias) and issubclass(obj, BeetsPlugin) and obj != BeetsPlugin and not inspect.isabstract(obj) diff --git a/docs/changelog.rst b/docs/changelog.rst index dadd6b73d..d7d8f6efb 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -72,8 +72,8 @@ For plugin developers: #. :class:`beets.metadata_plugin.MetadataSourcePlugin` allows plugins to act like metadata sources. E.g. used by the MusicBrainz plugin. All plugins in the beets repo are opted into this class where applicable. If you are maintaining a plugin - that acts like a metadata source, i.e. you expose any of `track_for_id, - album_for_id, candidates, item_candidates, album_distance, track_distance` methods, + that acts like a metadata source, i.e. you expose any of ``track_for_id``, + ``album_for_id``, ``candidates``, ``item_candidates``, ``album_distance``, ``track_distance`` methods, please update your plugin to inherit from the new baseclass, as otherwise it will not be registered as a metadata source and wont be usable going forward.