small tweaks
authorMarcel van der Veldt <m.vanderveldt@outlook.com>
Mon, 19 Aug 2024 21:57:50 +0000 (23:57 +0200)
committerMarcel van der Veldt <m.vanderveldt@outlook.com>
Mon, 19 Aug 2024 21:57:50 +0000 (23:57 +0200)
music_assistant/server/providers/spotify/__init__.py

index 32fae811a32c42a9594be6feef9ff1c7cb91d8ee..7535ea5dacf6f7f3766e4c4d5943ed5067df5596 100644 (file)
@@ -755,7 +755,7 @@ class SpotifyProvider(MusicProvider):
     async def login(self) -> dict:
         """Log-in Spotify and return Auth/token info."""
         # return existing token if we have one in memory
-        if self._auth_info and (self._auth_info["expires_at"] > (time.time() - 120)):
+        if self._auth_info and (self._auth_info["expires_at"] > (time.time() - 300)):
             return self._auth_info
 
         # request new access token using the refresh token
@@ -783,7 +783,7 @@ class SpotifyProvider(MusicProvider):
             auth_info["expires_at"] = int(auth_info["expires_in"] + time.time())
             self.logger.debug("Successfully refreshed access token")
 
-        # make sure that our updated creds get stored in memory + config config
+        # make sure that our updated creds get stored in memory + config
         self._auth_info = auth_info
         self.mass.config.set_raw_provider_config_value(
             self.instance_id, CONF_REFRESH_TOKEN, auth_info["refresh_token"], encrypted=True