diff --git a/api/v1/music/music.go b/api/v1/music/music.go index ea408f5..e85b6f5 100644 --- a/api/v1/music/music.go +++ b/api/v1/music/music.go @@ -53,7 +53,7 @@ var placeholders = []MusicRelease{ Buyname: "go get it!!", Buylink: "https://arimelody.me/", Links: []MusicLink{ - MusicLink{ + { Name: "youtube", Url: "https://youtu.be/dQw4w9WgXcQ", }, @@ -61,19 +61,19 @@ var placeholders = []MusicRelease{ Description: `Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas viverra ligula interdum, tempor metus venenatis, tempus est. Praesent semper vulputate nulla, a venenatis libero elementum id. Proin maximus aliquet accumsan. Integer eu orci congue, ultrices leo sed, maximus risus. Integer laoreet non urna non accumsan. Cras ut sollicitudin justo. Vivamus eu orci tempus, aliquet est rhoncus, tempus neque. Aliquam tempor sit amet nibh sed tempus. Nulla vitae bibendum purus. Sed in mi enim. Nam pharetra enim lorem, vel tristique diam malesuada a. Duis dignissim nunc mi, id semper ex tincidunt a. Sed laoreet consequat lacus a consectetur. Nulla est diam, tempus eget lacus ullamcorper, tincidunt faucibus ex. Duis consectetur felis sit amet ante fermentum interdum. Sed pulvinar laoreet tellus.`, Credits: []MusicCredit{ - MusicCredit{ + { Artist: &ari, Role: "having the swag", }, - MusicCredit{ + { Artist: &zaire, Role: "having the swag", }, - MusicCredit{ + { Artist: &mae, Role: "having the swag", }, - MusicCredit{ + { Artist: &loudar, Role: "having the swag", }, @@ -184,34 +184,34 @@ var placeholders = []MusicRelease{ Artwork: "https://mellodoot.com/img/music_artwork/mellodoot_-_Dream.webp", Buylink: "https://arimelody.bandcamp.com/track/dream", Links: []MusicLink{ - MusicLink{ + { Name: "spotify", Url: "https://open.spotify.com/album/5talRpqzjExP1w6j5LFIAh", }, - MusicLink{ + { Name: "apple music", Url: "https://music.apple.com/ie/album/dream-single/1650037132", }, - MusicLink{ + { Name: "soundcloud", Url: "https://soundcloud.com/arimelody/dream2022", }, - MusicLink{ + { Name: "youtube", Url: "https://www.youtube.com/watch?v=nfFgtMuYAx8", }, }, Description: "living the dream 🌌 ✨", Credits: []MusicCredit{ - MusicCredit{ + { Artist: &mellodoot, Role: "vocals", }, - MusicCredit{ + { Artist: &mellodoot, Role: "production", }, - MusicCredit{ + { Artist: &mellodoot, Role: "artwork", }, @@ -252,34 +252,34 @@ var placeholders = []MusicRelease{ Artwork: "https://mellodoot.com/img/music_artwork/mellodoot_-_Go_My_Way.webp", Buylink: "https://arimelody.bandcamp.com/track/go-my-way", Links: []MusicLink{ - MusicLink{ + { Name: "spotify", Url: "https://open.spotify.com/album/35WNtxK12IDHCUoXHDePGE", }, - MusicLink{ + { Name: "apple music", Url: "https://music.apple.com/ie/album/go-my-way-single/1547145699", }, - MusicLink{ + { Name: "soundcloud", Url: "https://soundcloud.com/arimelody/go-my-way", }, - MusicLink{ + { Name: "youtube", Url: "https://www.youtube.com/watch?v=CNptNQdLkl0", }, }, Description: "hey! go my way! 💥 ✨", Credits: []MusicCredit{ - MusicCredit{ + { Artist: &mellodoot, Role: "vocals", }, - MusicCredit{ + { Artist: &mellodoot, Role: "production", }, - MusicCredit{ + { Artist: &mellodoot, Role: "artwork", }, @@ -312,15 +312,15 @@ var placeholders = []MusicRelease{ }, Description: "let's take a trip. i've got a goddamn boat ⛵️", Credits: []MusicCredit{ - MusicCredit{ + { Artist: &mellodoot, Role: "vocals", }, - MusicCredit{ + { Artist: &mellodoot, Role: "production", }, - MusicCredit{ + { Artist: &mellodoot, Role: "artwork", }, @@ -353,15 +353,15 @@ var placeholders = []MusicRelease{ }, Description: "we'll dawn a new frontier! 👾", Credits: []MusicCredit{ - MusicCredit{ + { Artist: &mellodoot, Role: "vocals", }, - MusicCredit{ + { Artist: &mellodoot, Role: "production", }, - MusicCredit{ + { Artist: &mellodoot, Role: "artwork", }, @@ -388,11 +388,11 @@ var placeholders = []MusicRelease{ }, }, Credits: []MusicCredit{ - MusicCredit{ + { Artist: &zaire, Role: "production", }, - MusicCredit{ + { Artist: &mellodoot, Role: "production", }, @@ -424,11 +424,11 @@ var placeholders = []MusicRelease{ }, }, Credits: []MusicCredit{ - MusicCredit{ + { Artist: &mellodoot, Role: "production", }, - MusicCredit{ + { Artist: &mellodoot, Role: "artwork", }, @@ -460,15 +460,15 @@ var placeholders = []MusicRelease{ }, }, Credits: []MusicCredit{ - MusicCredit{ + { Artist: &mellodoot, Role: "vocals", }, - MusicCredit{ + { Artist: &mellodoot, Role: "production", }, - MusicCredit{ + { Artist: &mellodoot, Role: "artwork", }, @@ -500,11 +500,11 @@ var placeholders = []MusicRelease{ }, }, Credits: []MusicCredit{ - MusicCredit{ + { Artist: &mellodoot, Role: "production", }, - MusicCredit{ + { Artist: &mellodoot, Role: "artwork", }, @@ -546,11 +546,11 @@ var placeholders = []MusicRelease{ }, }, Credits: []MusicCredit{ - MusicCredit{ + { Artist: &mellodoot, Role: "production", }, - MusicCredit{ + { Artist: &red, Role: "artwork", Meta: true, @@ -576,11 +576,11 @@ var placeholders = []MusicRelease{ }, }, Credits: []MusicCredit{ - MusicCredit{ + { Artist: &mellodoot, Role: "production", }, - MusicCredit{ + { Artist: &red, Role: "artwork", Meta: true, @@ -607,11 +607,11 @@ var placeholders = []MusicRelease{ }, Description: "an 8-bit expedition! ⚔️🛡️", Credits: []MusicCredit{ - MusicCredit{ + { Artist: &mellodoot, Role: "production", }, - MusicCredit{ + { Artist: &mellodoot, Role: "artwork", }, diff --git a/main.go b/main.go index 21822a4..0087639 100644 --- a/main.go +++ b/main.go @@ -85,7 +85,7 @@ func handle_request(writer http.ResponseWriter, req *http.Request) { return index_handler(writer, root) } - if uri == "/music" { + if uri == "/music" || uri == "/music/" { return music_directory_handler(writer, root) } @@ -121,11 +121,6 @@ func music_directory_handler(writer http.ResponseWriter, root *template.Template } func music_gateway_handler(writer http.ResponseWriter, req *http.Request, root *template.Template) int { - if len(req.URL.Path) <= len("/music/") { - http.Error(writer, "400 bad request", http.StatusBadRequest) - return 400 - } - id := req.URL.Path[len("/music/"):] // http.Redirect(writer, req, "https://mellodoot.com/music/"+title, 302) // return diff --git a/views/htmx-base.html b/views/htmx-base.html index f1e1d13..a08e0c4 100644 --- a/views/htmx-base.html +++ b/views/htmx-base.html @@ -3,6 +3,7 @@ {{block "head" .}}{{end}} + diff --git a/views/music-gateway.html b/views/music-gateway.html index 54f208e..76281bf 100644 --- a/views/music-gateway.html +++ b/views/music-gateway.html @@ -24,8 +24,8 @@ - + {{end}} {{define "content"}}