move to src

This commit is contained in:
joshrmcdaniel
2024-05-12 10:20:49 -05:00
parent 61b9078af5
commit 4e0c81071b
2 changed files with 7 additions and 2 deletions

View File

@@ -6,7 +6,12 @@ import tidalapi
import webbrowser
import yaml
def open_spotify_session(config):
__all__ = [
'open_spotify_session',
'open_tidal_session'
]
def open_spotify_session(config) -> spotipy.Spotify:
credentials_manager = spotipy.SpotifyOAuth(username=config['username'],
scope='playlist-read-private',
client_id=config['client_id'],
@@ -19,7 +24,7 @@ def open_spotify_session(config):
return spotipy.Spotify(oauth_manager=credentials_manager)
def open_tidal_session(config = None):
def open_tidal_session(config = None) -> tidalapi.Session:
try:
with open('.session.yml', 'r') as session_file:
previous_session = yaml.safe_load(session_file)