def details_of_trending_song(): trending_songs = Models.get_trending_songs() print(trending_songs) if trending_songs is None: return None trending_songs = song_details_to_send(trending_songs) print(trending_songs) return song_list.Song_list("Trending Songs", trending_songs)
def listGenres(): genre = request.args.get('my_var', None) list1 = Models.retrieve_songs_artist_genre('genre', genre) list1 = song_details_to_send(list1) data = song_list.Song_list(genre, list1) print("list retrieved", list1) print(data.list_of_songs) return jsonify(data1=render_template('genre.html', data=data))
def listArtists(): artist = request.args.get('my_var', None) list1 = Models.retrieve_songs_artist_genre('artist', artist) list1 = song_details_to_send(list1) print(artist + "hey") print("list retrieved", list1) data = song_list.Song_list(artist, list1) print(data.list_of_songs) return jsonify(data1=render_template('artist.html', data=data))
def radio(): print("here in radio") data = [] list_of_songs = [] mode_playlist = ["workout", "devotional", "party"] for list_of_mode in mode_playlist: list_of_songs = Models.retrieve_songs_mode(list_of_mode) data.append(song_list.Song_list(list_of_mode, list_of_songs)) return jsonify(data1=render_template('radio.html', data=data))
def mymusic(): email_id = current_user.email_id data_playlist = [] table_name_playlist_track = get_playlist_track_name(email_id) table_name_playlist = get_playlist_name(email_id) data_playlist = Models.retrieve_playlist_table_track( table_name_playlist_track) data = [] final_list = [] for list1 in data_playlist: list2 = Models.retrieve_songs_playlist(table_name_playlist, list1) final_list = song_details_to_send(list2) data.append(song_list.Song_list(list1, final_list)) print(data) return jsonify(data1=render_template('mymusic.html', data=data))
def data_for_registered_user(): favourite_songs = Models.get_favourite_songs(current_user.email_id) favourite_songs = song_details_to_send(favourite_songs) return song_list.Song_list("Favourite Songs", favourite_songs)