Skip to content

Commit 04a3dd2

Browse files
committed
Adjusted typehint for search api. Removed optional none from filter.
1 parent 1f15598 commit 04a3dd2

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

beets/plugins.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -739,7 +739,7 @@ def track_url(self) -> str:
739739
def _search_api(
740740
self,
741741
query_type: Literal["album", "track"],
742-
filters: dict[str, str] | None,
742+
filters: dict[str, str],
743743
keywords: str = "",
744744
) -> Sequence[R]:
745745
raise NotImplementedError

beetsplug/deezer.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -232,16 +232,23 @@ def _construct_search_query(
232232

233233
def _search_api(
234234
self,
235-
query_type: Literal["album", "track"],
235+
query_type: Literal[
236+
"album",
237+
"track",
238+
"artist",
239+
"history",
240+
"playlist",
241+
"podcast",
242+
"radio",
243+
"user",
244+
],
236245
filters: dict[str, str],
237246
keywords="",
238247
) -> Sequence[Response]:
239248
"""Query the Deezer Search API for the specified ``keywords``, applying
240249
the provided ``filters``.
241250
242251
:param query_type: The Deezer Search API method to use.
243-
Valid types are: 'album', 'artist', 'history', 'playlist',
244-
'podcast', 'radio', 'track', 'user', and 'track'.
245252
:param keywords: (Optional) Query keywords to use.
246253
:return: JSON data for the class:`Response <Response>` object or None
247254
if no search results are returned.

0 commit comments

Comments
 (0)