Skip to content

Commit

Permalink
Update spotify.py
Browse files Browse the repository at this point in the history
  • Loading branch information
JarbasAl authored Nov 20, 2024
1 parent f78dbf5 commit cb28efc
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions spotify.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@

import requests
import spotipy
from ovos_backend_client.api import OAuthApi
from ovos_utils.oauth import OAuthTokenDatabase, OAuthApplicationDatabase
from ovos_utils.oauth import OAuthTokenDatabase, OAuthApplicationDatabase, get_oauth_token
from ovos_utils.log import LOG
from ovos_utils.parse import match_one, fuzzy_match, MatchStrategy
from ovos_utils.xdg_utils import xdg_config_home
Expand Down Expand Up @@ -47,8 +46,7 @@ def is_token_expired(token_info: dict):

@staticmethod
def get_access_token():
t = OAuthApi().get_oauth_token(OAUTH_TOKEN_ID,
auto_refresh=True)
t = get_oauth_token(OAUTH_TOKEN_ID, auto_refresh=True)
# TODO auto_refresh flag not working
if OVOSSpotifyCredentials.is_token_expired(t):
LOG.warning("SPOTIFY TOKEN EXPIRED")
Expand Down

0 comments on commit cb28efc

Please sign in to comment.