From c3bad99e43ee64eb485f570e6e695ee7b1ef0c65 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Bruckert?= Date: Sun, 12 Jan 2020 15:14:25 +0000 Subject: [PATCH] Revert "Remove unnecessary token_info parameter for oauth2.SpotifyClientCredentials methods (#223)" (#417) This reverts commit 908a92897b45baaa99a6fcbad9c84cfc407a908c. --- spotipy/oauth2.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/spotipy/oauth2.py b/spotipy/oauth2.py index 47c13fa..f749974 100644 --- a/spotipy/oauth2.py +++ b/spotipy/oauth2.py @@ -94,15 +94,14 @@ class SpotifyClientCredentials(object): token_info = response.json() return token_info - def is_token_expired(self): - return is_token_expired(self.token_info) + def is_token_expired(self, token_info): + return is_token_expired(token_info) - def _add_custom_values_to_token_info(self): + def _add_custom_values_to_token_info(self, token_info): """ Store some values that aren't directly provided by a Web API response. """ - token_info = self.token_info token_info['expires_at'] = int(time.time()) + token_info['expires_in'] return token_info