mirror of
https://github.com/beetbox/beets.git
synced 2026-02-08 08:25:23 +01:00
Fix lint and mypy
This commit is contained in:
parent
e257b7a82e
commit
dda1e8329e
2 changed files with 19 additions and 16 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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}$"
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue