feat: Update Dockerfile to use new UV system
All checks were successful
Check Code Quality / RuffCheck (push) Successful in 2m44s
Build Docker / BuildImage (push) Successful in 3m15s

Also fixes error in spotify refreshing
This commit is contained in:
2025-11-01 12:17:25 +11:00
parent 1888160fa5
commit b8f3039629
3 changed files with 39 additions and 10 deletions

View File

@@ -25,6 +25,10 @@ def refresh_access_token():
"""Refresh Spotify access token when expired."""
global ACCESS_TOKEN, TOKEN_EXPIRES
# If no refresh token, cannot proceed
if not REFRESH_TOKEN:
return None
# If still valid, reuse it
if ACCESS_TOKEN and time.time() < TOKEN_EXPIRES - 60:
return ACCESS_TOKEN
@@ -100,7 +104,7 @@ def get_spotify_track():
"""Internal function to get current playing track without HTTP context."""
token = refresh_access_token()
if not token:
return json_response(request, {"error": "Failed to refresh access token"}, 500)
return {"error": "Failed to refresh access token"}
headers = {"Authorization": f"Bearer {token}"}
response = requests.get(SPOTIFY_CURRENTLY_PLAYING_URL, headers=headers)