Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drop backend client #26

Merged
merged 4 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
ovos-utils>=0.1.0
ovos-utils>=0.5.0
ovos-bus-client>=0.0.9,<2.0.0
ovos-workshop>=0.0.16,<4.0.0
ovos-backend-client>=0.1.0,<2.0.0
spotipy
spotipy
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Add version constraints for spotipy dependency.

The spotipy dependency should have version constraints to ensure:

  • Consistent builds across environments
  • Protection against breaking changes
  • Security through pinned versions
-spotipy
+spotipy>=2.19.0,<3.0.0
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
spotipy
spotipy>=2.19.0,<3.0.0

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_backend_client.database 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
Loading