fixed bug in liking songs

This commit is contained in:
Brandon4466
2023-03-21 22:21:45 -07:00
parent 1c4024be7d
commit ef4d0fee66
2 changed files with 6 additions and 5 deletions

View File

@@ -97,10 +97,10 @@ def controlNext():
def controlPrevious():
spotify.previous_track()
def likeSong(is_bright):
def likeSong():
if spotify.current_user_saved_tracks_contains(tracks=[(spotify.current_playback()["item"]["id"])])[0] is False:
spotify.current_user_saved_tracks_add(tracks=[(spotify.current_playback()["item"]["id"])])
if is_bright is True:
if isBright is True:
play_button.config(image=play_heart_img_black)
pause_button.config(image=pause_heart_img_black)
else:
@@ -108,7 +108,7 @@ def likeSong(is_bright):
pause_button.config(image=pause_heart_img)
else:
spotify.current_user_saved_tracks_delete(tracks=[(spotify.current_playback()["item"]["id"])])
if is_bright is True:
if isBright is True:
play_button.config(image=play_img_black)
pause_button.config(image=pause_img_black)
else:
@@ -338,6 +338,7 @@ album_art_label.bind("<Button-1>", lambda e:likeSong())
def update_song_label():
global lrc
global album_art_img
global isBright
# Get the current playback information
current_playback = spotify.current_playback()
# If there is no current playback, set the text of the song label to "No playback"
@@ -396,7 +397,7 @@ def update_song_label():
previous_button.config(background=bg_color)
lyrics_label_frame.config(background=bg_color)
lyrics_label.config(background=bg_color)
colorUI(track_id, album_art_img_open)
isBright = colorUI(track_id, album_art_img_open)
# print(oauth.get_cached_token()["access_token"])
# print(current_playback["item"]["id"])
# canvas_url = canvas.get_canvas_for_track(access_token=oauth.get_cached_token()["access_token"], track_id=current_playback["item"]["id"])