Skip to content

Commit

Permalink
added client_manager creation
Browse files Browse the repository at this point in the history
  • Loading branch information
retrohacking committed Sep 30, 2023
1 parent 033ea03 commit 922c833
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion gensort.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def authorization(client_tokens):
def load_gensort():
client_tokens=retrieve_tokens()
user_token=authorization(client_tokens)
return client_tokens, user_token
return get_client_manager(client_tokens), user_token

def run_gensort(client_manager, token):
pass
2 changes: 1 addition & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ def main():
run_gensort(client_manager, token)

if __name__=="__main__":
main()
main()
6 changes: 2 additions & 4 deletions utils/authorization_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,11 @@
from webbrowser import open
import glob


LOGIN_PAGE="https://accounts.spotify.com/it/login"
CREATE_APP_PAGE="https://developer.spotify.com/dashboard/create"

def get_client_manager(client_id, client_secret):
return SpotifyClientCredentials(client_id=client_id, client_secret=client_secret)
def get_client_manager(client_tokens):
return SpotifyClientCredentials(client_id=client_tokens["client_id"], client_secret=client_tokens["client_secret"])

def have_tokens():
exists_tokens_file=check_json(TOKENS_FILE)
Expand All @@ -23,7 +22,6 @@ def have_tokens():
return False
return True


def configure_tokens():
while True:
tokens={}
Expand Down

0 comments on commit 922c833

Please sign in to comment.