diff --git a/beetsplug/lyrics.py b/beetsplug/lyrics.py index 466421a407..7b3980112a 100644 --- a/beetsplug/lyrics.py +++ b/beetsplug/lyrics.py @@ -26,7 +26,7 @@ from contextlib import contextmanager from functools import cached_property from html import unescape -from typing import Any, Iterator +from typing import Any, ClassVar, Iterator from urllib.parse import urlparse import requests @@ -242,12 +242,13 @@ class BackendType(type): >>> list(Backend) # ["lrclib", "musixmatch", "genius", "tekstowo", "google"] """ - _registry: dict[str, BackendType] = {} - REQUIRES_BS: bool + _registry: ClassVar[dict[str, BackendType]] = {} + REQUIRES_BS: ClassVar[bool] - def __new__(cls, name: str, bases: tuple[type, ...], attrs) -> BackendType: + def __new__(cls, name: str, bases: tuple[type, ...], *args) -> BackendType: """Create a new instance of the class and add it to the registry.""" - new_class = super().__new__(cls, name, bases, attrs) + new_class = super().__new__(cls, name, bases, *args) + # Skip the base / Backend class if bases: cls._registry[name.lower()] = new_class return new_class