Skip to content

Commit

Permalink
small tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelveldt committed Aug 19, 2024
1 parent 61271a5 commit 0a048b4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions music_assistant/server/providers/spotify/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ def _parse_playlist(self, playlist_obj):
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
Expand Down Expand Up @@ -783,7 +783,7 @@ async def login(self) -> dict:
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
Expand Down

0 comments on commit 0a048b4

Please sign in to comment.