Skip to content

Commit 14690c7

Browse files
authored
Remove blocking call (#319)
1 parent 2675ca3 commit 14690c7

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/spotifyaio/spotify.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@
5050
if TYPE_CHECKING:
5151
from spotifyaio import SimplifiedAlbum, Track
5252

53+
VERSION = metadata.version(__package__)
54+
5355

5456
@dataclass
5557
class SpotifyClient:
@@ -80,7 +82,6 @@ async def _request(
8082
params: dict[str, Any] | None = None,
8183
) -> str:
8284
"""Handle a request to Spotify."""
83-
version = metadata.version(__package__)
8485
url = URL.build(
8586
scheme="https",
8687
host=self.api_host,
@@ -90,7 +91,7 @@ async def _request(
9091
await self.refresh_token()
9192

9293
headers = {
93-
"User-Agent": f"AioSpotify/{version}",
94+
"User-Agent": f"AioSpotify/{VERSION}",
9495
"Accept": "application/json, text/plain, */*",
9596
"Authorization": f"Bearer {self._token}",
9697
}

0 commit comments

Comments
 (0)