|
5 | 5 | import asyncio |
6 | 6 | from dataclasses import dataclass |
7 | 7 | from importlib import metadata |
8 | | -from typing import TYPE_CHECKING, Any, Callable, Concatenate, Self |
| 8 | +from typing import TYPE_CHECKING, Any, Concatenate, Self |
9 | 9 |
|
10 | 10 | from aiohttp import ClientSession |
11 | 11 | from aiohttp.hdrs import METH_DELETE, METH_GET, METH_POST, METH_PUT |
|
79 | 79 | from spotifyaio.util import get_identifier |
80 | 80 |
|
81 | 81 | if TYPE_CHECKING: |
82 | | - from collections.abc import Awaitable |
| 82 | + from collections.abc import Awaitable, Callable |
83 | 83 |
|
84 | 84 | from spotifyaio import SimplifiedAlbum, SimplifiedTrack, Track |
85 | 85 |
|
@@ -275,7 +275,7 @@ async def are_albums_saved(self, album_ids: list[str]) -> dict[str, bool]: |
275 | 275 | params: dict[str, Any] = {"ids": ",".join(identifiers)} |
276 | 276 | response = await self._get("v1/me/albums/contains", params=params) |
277 | 277 | body: list[bool] = orjson.loads(response) # pylint: disable=no-member |
278 | | - return dict(zip(identifiers, body)) |
| 278 | + return dict(zip(identifiers, body, strict=False)) |
279 | 279 |
|
280 | 280 | async def is_album_saved(self, album_id: str) -> bool: |
281 | 281 | """Check if album is saved.""" |
@@ -395,7 +395,7 @@ async def are_audiobooks_saved(self, audiobook_ids: list[str]) -> dict[str, bool |
395 | 395 | params: dict[str, Any] = {"ids": ",".join(identifiers)} |
396 | 396 | response = await self._get("v1/me/audiobooks/contains", params=params) |
397 | 397 | body: list[bool] = orjson.loads(response) # pylint: disable=no-member |
398 | | - return dict(zip(identifiers, body)) |
| 398 | + return dict(zip(identifiers, body, strict=False)) |
399 | 399 |
|
400 | 400 | @catch_json_decode_error |
401 | 401 | async def get_categories(self) -> list[Category]: |
@@ -495,7 +495,7 @@ async def are_episodes_saved(self, episode_ids: list[str]) -> dict[str, bool]: |
495 | 495 | params: dict[str, Any] = {"ids": ",".join(identifiers)} |
496 | 496 | response = await self._get("v1/me/episodes/contains", params=params) |
497 | 497 | body: list[bool] = orjson.loads(response) # pylint: disable=no-member |
498 | | - return dict(zip(identifiers, body)) |
| 498 | + return dict(zip(identifiers, body, strict=False)) |
499 | 499 |
|
500 | 500 | async def is_episode_saved(self, episode_id: str) -> bool: |
501 | 501 | """Check if episode is saved.""" |
@@ -868,7 +868,7 @@ async def are_shows_saved(self, show_ids: list[str]) -> dict[str, bool]: |
868 | 868 | params: dict[str, Any] = {"ids": ",".join(identifiers)} |
869 | 869 | response = await self._get("v1/me/shows/contains", params=params) |
870 | 870 | body: list[bool] = orjson.loads(response) # pylint: disable=no-member |
871 | | - return dict(zip(identifiers, body)) |
| 871 | + return dict(zip(identifiers, body, strict=False)) |
872 | 872 |
|
873 | 873 | async def is_show_saved(self, show_id: str) -> bool: |
874 | 874 | """Check if show is saved.""" |
@@ -922,7 +922,7 @@ async def are_tracks_saved(self, track_ids: list[str]) -> dict[str, bool]: |
922 | 922 | params: dict[str, Any] = {"ids": ",".join(identifiers)} |
923 | 923 | response = await self._get("v1/me/tracks/contains", params=params) |
924 | 924 | body: list[bool] = orjson.loads(response) # pylint: disable=no-member |
925 | | - return dict(zip(identifiers, body)) |
| 925 | + return dict(zip(identifiers, body, strict=False)) |
926 | 926 |
|
927 | 927 | async def is_track_saved(self, track_id: str) -> bool: |
928 | 928 | """Check if track is saved.""" |
@@ -1019,7 +1019,7 @@ async def are_accounts_followed( |
1019 | 1019 | params: dict[str, Any] = {"type": follow_type, "ids": ",".join(identifiers)} |
1020 | 1020 | response = await self._get("v1/me/following/contains", params=params) |
1021 | 1021 | body: list[bool] = orjson.loads(response) # pylint: disable=no-member |
1022 | | - return dict(zip(identifiers, body)) |
| 1022 | + return dict(zip(identifiers, body, strict=False)) |
1023 | 1023 |
|
1024 | 1024 | @catch_json_decode_error |
1025 | 1025 | async def is_following_playlist(self, playlist_id: str) -> bool: |
|
0 commit comments