first commit! 🎉
Signed-off-by: ari melody <ari@arimelody.me>
This commit is contained in:
commit
27d6e4f011
97 changed files with 2957 additions and 0 deletions
343
api/v1/music/music.go
Normal file
343
api/v1/music/music.go
Normal file
|
@ -0,0 +1,343 @@
|
|||
package music
|
||||
|
||||
var placeholders = []Album{
|
||||
{
|
||||
Id: "test",
|
||||
Title: "test album",
|
||||
Type: "album",
|
||||
Year: 2024,
|
||||
Buyname: "go get it!!",
|
||||
Buylink: "https://arimelody.me/",
|
||||
Artists: []string{
|
||||
"ari melody",
|
||||
"zaire",
|
||||
"mae taylor",
|
||||
"Loudar",
|
||||
},
|
||||
Links: []AlbumLink{
|
||||
AlbumLink{
|
||||
Name: "youtube",
|
||||
Url: "https://youtu.be/dQw4w9WgXcQ",
|
||||
},
|
||||
},
|
||||
Description: "she sample on my text 'til i 🚫🚫🚫",
|
||||
},
|
||||
{
|
||||
Id: "free2play",
|
||||
Title: "free2play",
|
||||
Type: "upcoming",
|
||||
Year: 2024,
|
||||
Buyname: "pre-order",
|
||||
Buylink: "https://arimelody.me/",
|
||||
Artists: []string{ "ari melody" },
|
||||
Description: "hello from your local SPACEGIRL! 💫",
|
||||
},
|
||||
{
|
||||
Id: "dream",
|
||||
Title: "Dream",
|
||||
Type: "single",
|
||||
Year: 2022,
|
||||
Artists: []string{ "mellodoot" },
|
||||
Artwork: "https://mellodoot.com/img/music_artwork/mellodoot_-_Dream.webp",
|
||||
Buylink: "https://arimelody.bandcamp.com/track/dream",
|
||||
Free: false,
|
||||
Links: []AlbumLink{
|
||||
AlbumLink{
|
||||
Name: "spotify",
|
||||
Url: "https://open.spotify.com/album/5talRpqzjExP1w6j5LFIAh",
|
||||
},
|
||||
AlbumLink{
|
||||
Name: "apple music",
|
||||
Url: "https://music.apple.com/ie/album/dream-single/1650037132",
|
||||
},
|
||||
AlbumLink{
|
||||
Name: "soundcloud",
|
||||
Url: "https://soundcloud.com/arimelody/dream2022",
|
||||
},
|
||||
AlbumLink{
|
||||
Name: "youtube",
|
||||
Url: "https://www.youtube.com/watch?v=nfFgtMuYAx8",
|
||||
},
|
||||
},
|
||||
Description: "living the dream 🌌 ✨",
|
||||
},
|
||||
{
|
||||
Id: "gomyway",
|
||||
Title: "Go My Way",
|
||||
Type: "single",
|
||||
Year: 2021,
|
||||
Artists: []string{ "mellodoot" },
|
||||
Artwork: "https://mellodoot.com/img/music_artwork/mellodoot_-_Go_My_Way.webp",
|
||||
Buylink: "https://arimelody.bandcamp.com/track/go-my-way",
|
||||
Links: []AlbumLink{
|
||||
AlbumLink{
|
||||
Name: "spotify",
|
||||
Url: "https://open.spotify.com/album/35WNtxK12IDHCUoXHDePGE",
|
||||
},
|
||||
AlbumLink{
|
||||
Name: "apple music",
|
||||
Url: "https://music.apple.com/ie/album/go-my-way-single/1547145699",
|
||||
},
|
||||
AlbumLink{
|
||||
Name: "soundcloud",
|
||||
Url: "https://soundcloud.com/arimelody/go-my-way",
|
||||
},
|
||||
AlbumLink{
|
||||
Name: "youtube",
|
||||
Url: "https://www.youtube.com/watch?v=CNptNQdLkl0",
|
||||
},
|
||||
},
|
||||
Description: "hey! go my way! 💥 ✨",
|
||||
},
|
||||
{
|
||||
Id: "rowboat",
|
||||
Title: "Rowboat",
|
||||
Type: "single",
|
||||
Year: 2020,
|
||||
Artists: []string{ "mellodoot" },
|
||||
Artwork: "https://mellodoot.com/img/music_artwork/mellodoot_-_Rowboat.webp",
|
||||
Buylink: "https://arimelody.bandcamp.com/track/rowboat",
|
||||
Links: []AlbumLink{
|
||||
{
|
||||
Name: "spotify",
|
||||
Url: "https://open.spotify.com/album/7jyqJFVKaENCPm58v5O44Y",
|
||||
},
|
||||
{
|
||||
Name: "apple music",
|
||||
Url: "https://music.apple.com/ie/album/rowboat-single/1502608714",
|
||||
},
|
||||
{
|
||||
Name: "soundcloud",
|
||||
Url: "https://soundcloud.com/arimelody/rowboat",
|
||||
},
|
||||
{
|
||||
Name: "youtube",
|
||||
Url: "https://www.youtube.com/watch?v=uOQyILDTzME",
|
||||
},
|
||||
},
|
||||
Description: "let's take a trip. i've got a goddamn boat ⛵️",
|
||||
},
|
||||
{
|
||||
Id: "helloworld",
|
||||
Title: "Hello World",
|
||||
Type: "single",
|
||||
Year: 2019,
|
||||
Artists: []string{ "mellodoot" },
|
||||
Artwork: "https://mellodoot.com/img/music_artwork/mellodoot_-_Hello_World.webp",
|
||||
Buylink: "https://arimelody.bandcamp.com/track/hello-world",
|
||||
Links: []AlbumLink{
|
||||
{
|
||||
Name: "spotify",
|
||||
Url: "https://open.spotify.com/album/3LbElPXD4dsDumttGBuYxx",
|
||||
},
|
||||
{
|
||||
Name: "apple music",
|
||||
Url: "https://music.apple.com/ie/album/hello-world-single/1491880155",
|
||||
},
|
||||
{
|
||||
Name: "soundcloud",
|
||||
Url: "https://soundcloud.com/arimelody/helloworld",
|
||||
},
|
||||
{
|
||||
Name: "youtube",
|
||||
Url: "https://www.youtube.com/watch?v=CQhlRsl0Mjk",
|
||||
},
|
||||
},
|
||||
Description: "we'll dawn a new frontier! 👾",
|
||||
},
|
||||
{
|
||||
Id: "sine",
|
||||
Title: "Sine",
|
||||
Type: "single",
|
||||
Artists: []string{ "zaire", "mellodoot" },
|
||||
Year: 2019,
|
||||
Artwork: "https://mellodoot.com/img/music_artwork/zaire_-_Sine_ft._mellodoot.webp",
|
||||
Links: []AlbumLink{
|
||||
{
|
||||
Name: "spotify",
|
||||
Url: "https://open.spotify.com/album/4WPuaJtTV7z86KubD9Rnmk",
|
||||
},
|
||||
{
|
||||
Name: "apple music",
|
||||
Url: "https://music.apple.com/us/album/sine-feat-mellodoot/1489163020",
|
||||
},
|
||||
{
|
||||
Name: "youtube",
|
||||
Url: "https://www.youtube.com/watch?v=z1H1s6VRnyY",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
Id: "10",
|
||||
Title: "10",
|
||||
Type: "single",
|
||||
Year: 2019,
|
||||
Artists: []string{ "mellodoot" },
|
||||
Artwork: "https://mellodoot.com/img/music_artwork/mellodoot_-_10.webp",
|
||||
Buylink: "https://arimelody.bandcamp.com/track/10",
|
||||
Links: []AlbumLink{
|
||||
{
|
||||
Name: "spotify",
|
||||
Url: "https://open.spotify.com/album/2x4gbACfDm99unaXpLXyj0",
|
||||
},
|
||||
{
|
||||
Name: "apple music",
|
||||
Url: "https://music.apple.com/ie/album/ten-single/1483193041",
|
||||
},
|
||||
{
|
||||
Name: "soundcloud",
|
||||
Url: "https://soundcloud.com/arimelody/ten",
|
||||
},
|
||||
{
|
||||
Name: "youtube",
|
||||
Url: "https://www.youtube.com/watch?v=C7WP5L2BK4U",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
Id: "mad",
|
||||
Title: "MAD",
|
||||
Type: "single",
|
||||
Year: 2018,
|
||||
Artists: []string{ "mellodoot" },
|
||||
Artwork: "https://mellodoot.com/img/music_artwork/mellodoot_-_MAD.webp",
|
||||
Buylink: "https://arimelody.bandcamp.com/track/mad",
|
||||
Links: []AlbumLink{
|
||||
{
|
||||
Name: "spotify",
|
||||
Url: "https://open.spotify.com/album/59nFXw1WNoRhXou7lXqBZd",
|
||||
},
|
||||
{
|
||||
Name: "apple music",
|
||||
Url: "https://music.apple.com/ie/album/mad/1441233120",
|
||||
},
|
||||
{
|
||||
Name: "soundcloud",
|
||||
Url: "https://soundcloud.com/arimelody/mad",
|
||||
},
|
||||
{
|
||||
Name: "youtube",
|
||||
Url: "https://www.youtube.com/watch?v=OB-Pk6p6mfQ",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
Id: "welcomingparty",
|
||||
Title: "Welcoming Party",
|
||||
Type: "album",
|
||||
Year: 2018,
|
||||
Artists: []string{ "mellodoot" },
|
||||
Artwork: "https://mellodoot.com/img/music_artwork/mellodoot_-_Welcoming_Party.webp",
|
||||
Buylink: "https://arimelody.bandcamp.com/album/welcoming-party",
|
||||
Links: []AlbumLink{
|
||||
{
|
||||
Name: "spotify",
|
||||
Url: "https://open.spotify.com/album/3EPa4HZpkISQVRAks64LfR",
|
||||
},
|
||||
{
|
||||
Name: "apple music",
|
||||
Url: "https://music.apple.com/ie/album/welcoming-party-ep/1441161424",
|
||||
},
|
||||
{
|
||||
Name: "soundcloud",
|
||||
Url: "https://soundcloud.com/arimelody/sets/welcoming-party",
|
||||
},
|
||||
{
|
||||
Name: "youtube",
|
||||
Url: "https://www.youtube.com/playlist?list=PLBG_QJeOHrB5EeniiXBIlHpoQbD6CUJca",
|
||||
},
|
||||
},
|
||||
// "tracks": [
|
||||
// {
|
||||
// "title": "Paradigm"
|
||||
// },
|
||||
// {
|
||||
// "title": "Mitrio"
|
||||
// },
|
||||
// {
|
||||
// "title": "Level One"
|
||||
// },
|
||||
// {
|
||||
// "title": "Cubes"
|
||||
// },
|
||||
// {
|
||||
// "title": "Aria"
|
||||
// }
|
||||
// ]
|
||||
},
|
||||
{
|
||||
Id: "howtheyknow2018",
|
||||
Title: "How They Know (2018)",
|
||||
Type: "single",
|
||||
Year: 2018,
|
||||
Artists: []string{ "mellodoot" },
|
||||
Artwork: "https://mellodoot.com/img/music_artwork/mellodoot_-_How_They_Know_2018.webp",
|
||||
Buylink: "https://arimelody.bandcamp.com/track/how-they-know-2018-remastered",
|
||||
Free: true,
|
||||
Links: []AlbumLink{
|
||||
{
|
||||
Name: "soundcloud",
|
||||
Url: "https://soundcloud.com/arimelody/how-they-know-2018",
|
||||
},
|
||||
{
|
||||
Name: "youtube",
|
||||
Url: "https://www.youtube.com/watch?v=mbAgSwCzyMw",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
Id: "howtheyknow",
|
||||
Title: "How They Know",
|
||||
Type: "single",
|
||||
Year: 2017,
|
||||
Artists: []string{ "mellodoot" },
|
||||
Artwork: "https://mellodoot.com/img/music_artwork/mellodoot_-_How_They_Know.webp",
|
||||
Buylink: "https://arimelody.bandcamp.com/track/how-they-know",
|
||||
Free: true,
|
||||
Links: []AlbumLink{
|
||||
{
|
||||
Name: "soundcloud",
|
||||
Url: "https://soundcloud.com/arimelody/how-they-know",
|
||||
},
|
||||
{
|
||||
Name: "youtube",
|
||||
Url: "https://www.youtube.com/watch?v=q6lzKuG1Emo",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
Id: "traveller",
|
||||
Title: "Traveller",
|
||||
Type: "single",
|
||||
Year: 2017,
|
||||
Artists: []string{ "mellodoot" },
|
||||
Artwork: "https://mellodoot.com/img/music_artwork/mellodoot_-_Traveller.webp",
|
||||
Buylink: "https://arimelody.bandcamp.com/track/traveller",
|
||||
Free: true,
|
||||
Links: []AlbumLink{
|
||||
{
|
||||
Name: "soundcloud",
|
||||
Url: "https://soundcloud.com/arimelody/traveller",
|
||||
},
|
||||
{
|
||||
Name: "youtube",
|
||||
Url: "https://www.youtube.com/watch?v=ZTO7IQZ-yXA",
|
||||
},
|
||||
},
|
||||
Description: "an 8-bit expedition! ⚔️🛡️",
|
||||
},
|
||||
}
|
||||
|
||||
func GetAlbum(id string) (Album, bool) {
|
||||
for _, album := range placeholders {
|
||||
if album.Id == id {
|
||||
return album, true
|
||||
}
|
||||
}
|
||||
return Album{}, false
|
||||
}
|
||||
|
||||
func QueryAll() ([]Album) {
|
||||
return placeholders
|
||||
}
|
||||
|
55
api/v1/music/music_types.go
Normal file
55
api/v1/music/music_types.go
Normal file
|
@ -0,0 +1,55 @@
|
|||
package music
|
||||
|
||||
import (
|
||||
"regexp"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type (
|
||||
Album struct {
|
||||
Id string;
|
||||
Title string;
|
||||
Type string;
|
||||
Year int;
|
||||
Artists []string;
|
||||
Artwork string;
|
||||
Buyname string;
|
||||
Buylink string;
|
||||
Free bool;
|
||||
Links []AlbumLink;
|
||||
Description string;
|
||||
}
|
||||
|
||||
AlbumLink struct {
|
||||
Name string;
|
||||
Url string;
|
||||
}
|
||||
)
|
||||
|
||||
func (album Album) PrintArtists() string {
|
||||
if len(album.Artists) == 1 {
|
||||
return album.Artists[0]
|
||||
}
|
||||
res := strings.Join(album.Artists[:len(album.Artists) - 1], ", ")
|
||||
res += " & " + album.Artists[len(album.Artists) - 1]
|
||||
return res
|
||||
}
|
||||
|
||||
func (album Album) PrintCommaArtists() string {
|
||||
if len(album.Artists) == 1 {
|
||||
return album.Artists[0]
|
||||
}
|
||||
return strings.Join(album.Artists[:len(album.Artists)], ", ")
|
||||
}
|
||||
|
||||
func (album Album) ResolveArtwork() string {
|
||||
if album.Artwork != "" {
|
||||
return album.Artwork
|
||||
}
|
||||
return "/img/music-artwork/default.png"
|
||||
}
|
||||
|
||||
func (link AlbumLink) NormaliseName() string {
|
||||
re := regexp.MustCompile(`[^a-z0-9]`)
|
||||
return strings.ToLower(re.ReplaceAllString(link.Name, ""))
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue