env.Db.Db.Exec("INSERT INTO ARTIST (ID, NAME) VALUES (?, ?)", artist.ID, artist.Name)
for _, genre := range artist.Genres {
env.Db.Db.Exec("INSERT INTO ARTIST (ID, NAME) VALUES (?, ?)", artist.ID, artist.Name)
for _, genre := range artist.Genres {
if err != nil {
log.Printf("Failed to insert genre %s: %s", genre, err.Error())
http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError)
if err != nil {
log.Printf("Failed to insert genre %s: %s", genre, err.Error())
http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError)