From dda1e8329e0d93c59d35e4c9705c35c0240bf66e Mon Sep 17 00:00:00 2001 From: Brock Grassy Date: Wed, 4 Feb 2026 16:25:46 -0500 Subject: [PATCH] Fix lint and mypy --- beetsplug/_utils/musicbrainz.py | 9 ++++++--- beetsplug/missing.py | 26 +++++++++++++------------- 2 files changed, 19 insertions(+), 16 deletions(-) diff --git a/beetsplug/_utils/musicbrainz.py b/beetsplug/_utils/musicbrainz.py index 57e5860d4..33fb22380 100644 --- a/beetsplug/_utils/musicbrainz.py +++ b/beetsplug/_utils/musicbrainz.py @@ -238,10 +238,13 @@ class MusicBrainzAPI(RequestHandler): At least one of artist, collection, or release must be provided. Optionally filter by release_type (e.g., ["album", "ep"]). """ + api_params: dict[str, Any] = dict(kwargs) # MusicBrainz API uses "type" parameter for release type filtering - if release_type := kwargs.pop("release_type", None): - kwargs["type"] = "|".join(release_type) - return self._get_resource("release-group", **kwargs)["release-groups"] + if release_type := api_params.pop("release_type", None): + api_params["type"] = "|".join(release_type) + return self._get_resource("release-group", **api_params)[ + "release-groups" + ] @singledispatchmethod @classmethod diff --git a/beetsplug/missing.py b/beetsplug/missing.py index 164c34e28..d5ac037dc 100644 --- a/beetsplug/missing.py +++ b/beetsplug/missing.py @@ -22,6 +22,19 @@ from typing import TYPE_CHECKING, ClassVar import requests +from beets import config, metadata_plugins +from beets.dbcore import types +from beets.library import Item +from beets.plugins import BeetsPlugin +from beets.ui import Subcommand, print_ + +from ._utils.musicbrainz import MusicBrainzAPIMixin + +if TYPE_CHECKING: + from collections.abc import Iterator + + from beets.library import Album, Library + # Valid MusicBrainz release types for filtering release groups VALID_RELEASE_TYPES = [ "nat", @@ -41,19 +54,6 @@ VALID_RELEASE_TYPES = [ "mixtape/street", ] -from beets import config, metadata_plugins -from beets.dbcore import types -from beets.library import Item -from beets.plugins import BeetsPlugin -from beets.ui import Subcommand, print_ - -from ._utils.musicbrainz import MusicBrainzAPIMixin - -if TYPE_CHECKING: - from collections.abc import Iterator - - from beets.library import Album, Library - MB_ARTIST_QUERY = r"mb_albumartistid::^\w{8}-\w{4}-\w{4}-\w{4}-\w{12}$"