From 04a3dd21698f7da74a9db4cc40285db47988c0fd Mon Sep 17 00:00:00 2001 From: Sebastian Mohr Date: Wed, 18 Jun 2025 14:19:27 +0200 Subject: [PATCH] Adjusted typehint for search api. Removed optional none from filter. --- beets/plugins.py | 2 +- beetsplug/deezer.py | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/beets/plugins.py b/beets/plugins.py index 6ca2462e3..983d15402 100644 --- a/beets/plugins.py +++ b/beets/plugins.py @@ -739,7 +739,7 @@ class MetadataSourcePlugin(Generic[R], BeetsPlugin, metaclass=abc.ABCMeta): def _search_api( self, query_type: Literal["album", "track"], - filters: dict[str, str] | None, + filters: dict[str, str], keywords: str = "", ) -> Sequence[R]: raise NotImplementedError diff --git a/beetsplug/deezer.py b/beetsplug/deezer.py index 0ffaeda0b..38a269b50 100644 --- a/beetsplug/deezer.py +++ b/beetsplug/deezer.py @@ -232,7 +232,16 @@ class DeezerPlugin(MetadataSourcePlugin[Response], BeetsPlugin): def _search_api( self, - query_type: Literal["album", "track"], + query_type: Literal[ + "album", + "track", + "artist", + "history", + "playlist", + "podcast", + "radio", + "user", + ], filters: dict[str, str], keywords="", ) -> Sequence[Response]: @@ -240,8 +249,6 @@ class DeezerPlugin(MetadataSourcePlugin[Response], BeetsPlugin): the provided ``filters``. :param query_type: The Deezer Search API method to use. - Valid types are: 'album', 'artist', 'history', 'playlist', - 'podcast', 'radio', 'track', 'user', and 'track'. :param keywords: (Optional) Query keywords to use. :return: JSON data for the class:`Response ` object or None if no search results are returned.