def addSongs(self, eventID):
db = Database()
trackID = db.getTopSong(eventID)
spotify = Spotify()
token = db.getEventSpotifyToken(eventID)
if(trackID == -1):
trackID = spotify.recommend_fallback(eventID)
username = db.getHostSpotifyUserName(eventID)
playlist_id = db.getPlaylistID(eventID)
if(trackID == -1): print("NO TOP VOTED")
sp = spotipy.Spotify(auth=token)
sp.trace = False
print("100%")
sp.user_playlist_add_tracks(username, str(playlist_id), {str(trackID)})
print("NOT 100%")
评论列表
文章目录