From d15469d2b80480e25c674989af78040340627ddd Mon Sep 17 00:00:00 2001 From: Tari <65512380+Tari-dev@users.noreply.github.com> Date: Tue, 22 Feb 2022 15:35:22 +0530 Subject: [PATCH] Close Spotify session --- pomice/spotify/client.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pomice/spotify/client.py b/pomice/spotify/client.py index 5487168..cc3cf21 100644 --- a/pomice/spotify/client.py +++ b/pomice/spotify/client.py @@ -48,6 +48,8 @@ class Client: self._bearer_token = data["access_token"] self._expiry = time.time() + (int(data["expires_in"]) - 10) self._bearer_headers = {"Authorization": f"Bearer {self._bearer_token}"} + + async def search(self, *, query: str): if not self._bearer_token or time.time() >= self._expiry: @@ -102,3 +104,7 @@ class Client: next_page_url = next_data["next"] return Playlist(data, tracks) + + async def close(self): + await self.session.close() +