Skip to content

Commit

Permalink
Added verbose to exec_func
Browse files Browse the repository at this point in the history
  • Loading branch information
remi1111 committed Mar 30, 2024
1 parent 6063bd7 commit 72bb2ed
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/exec_func.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
""" Executable functions for main.py """
import json
import os

import spotify_api
import get_avs
Expand Down Expand Up @@ -34,9 +35,12 @@ def playlist_to_yt_dict(playlist, filename=None):
""" Turns a spotify playlist into a dictionary.
This dictionary contains relevant info and their youtube ids.
If no filename is given print to console. """
verbose = False
if os.environ["VERBOSE"] == "1":
verbose = True
token = spotify_api.get_token()
dict1 = spotify_api.get_playlist(playlist, token, [])
mydict = get_avs.get_dict_spotify(dict1)
mydict = get_avs.get_dict_spotify(dict1, verbose)
if filename:
write_to_file(mydict, filename)
else:
Expand Down

0 comments on commit 72bb2ed

Please sign in to comment.