def add_song(self, song, playlist_name): conn.execute("INSERT INTO song VALUES('" + song.name + "','" + song.release_date + "','" + song.lyrics + "','" + song.length + "','" + song.path + "','" + song.album + "')") conn.commit()
def add_song_band(self, song): for band_name in song.bands: conn.execute("INSERT INTO song_band VALUES('" + song.name + "','" + band_name + "'," + '0' + ")") for band_name in song.featured_bands: conn.execute("INSERT INTO song_band VALUES('" + song.name + "','" + band_name + "'," + '1' + ")") conn.commit()
def add_artist(self, artist): conn.execute("INSERT INTO artist " + "VALUES('" + artist.name + "', '" + artist.date_of_birth + "', '" + artist.band + "')") conn.commit()
def add_playlist_songs(self, song_name, playlist_name): conn.execute("INSERT INTO playlist_song VALUES('" + playlist_name + "','" + song_name + "')") conn.commit()
def remove_playlist_song(self, playlist_name, song_name): conn.execute("DELETE FROM playlist_song " + "WHERE playlist_name = '" + playlist_name + "' " + "AND song_name = '" + song_name + "'") conn.commit()
def remove_playlist(self, name): conn.execute("DELETE FROM playlist_song " + "WHERE playlist_name = '" + name + "'") conn.execute("DELETE FROM playlist " + "WHERE name = '" + name + "'") conn.commit()
def add_playlist(self, name, description): conn.execute("INSERT INTO playlist VALUES('" + name + "','" + description + "')") conn.commit()
def add_band(self, band_name): conn.execute("INSERT INTO band VALUES('" + band_name + "')") conn.commit()