home to your local SPACEGIRL 💫 arimelody.space
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

updated schema to support album tracks

Signed-off-by: ari melody <ari@arimelody.me>

+320 -802
+1
.gitattributes
··· 7 7 *.mp3 filter=lfs diff=lfs merge=lfs -text 8 8 *.mp4 filter=lfs diff=lfs merge=lfs -text 9 9 *.svg filter=lfs diff=lfs merge=lfs -text 10 + text eol=lf 10 11 . !text !filter !merge !diff 11 12 * !text !filter !merge !diff
-605
api/v1/music/music.go
··· 5 5 "time" 6 6 ) 7 7 8 - var ari = Artist{ 9 - Id: "arimelody", 10 - Name: "ari melody", 11 - Website: "https://arimelody.me", 12 - } 13 - var mellodoot = Artist{ 14 - Id: "mellodoot", 15 - Name: "mellodoot", 16 - Website: "https://mellodoot.com", 17 - } 18 - var zaire = Artist{ 19 - Id: "zaire", 20 - Name: "zaire", 21 - Website: "https://supitszaire.com", 22 - } 23 - var mae = Artist{ 24 - Id: "maetaylor", 25 - Name: "mae taylor", 26 - Website: "https://mae.wtf", 27 - } 28 - var loudar = Artist{ 29 - Id: "loudar", 30 - Name: "Loudar", 31 - Website: "https://alex.targoninc.com", 32 - } 33 - var red = Artist { 34 - Id: "smoljorb", 35 - Name: "smoljorb", 36 - } 37 - 38 8 func make_date_work(date string) time.Time { 39 9 res, err := time.Parse("2-Jan-2006", date) 40 10 if err != nil { ··· 42 12 return time.Unix(0, 0) 43 13 } 44 14 return res 45 - } 46 - 47 - var placeholders = []MusicRelease{ 48 - { 49 - Id: "test", 50 - Title: "test album", 51 - // Type: "album", 52 - ReleaseDate: make_date_work("18-Mar-2024"), 53 - Buyname: "go get it!!", 54 - Buylink: "https://arimelody.me/", 55 - Links: []MusicLink{ 56 - { 57 - Name: "youtube", 58 - Url: "https://youtu.be/dQw4w9WgXcQ", 59 - }, 60 - }, 61 - Description: 62 - `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.`, 63 - Credits: []MusicCredit{ 64 - { 65 - Artist: &ari, 66 - Role: "having the swag", 67 - }, 68 - { 69 - Artist: &zaire, 70 - Role: "having the swag", 71 - }, 72 - { 73 - Artist: &mae, 74 - Role: "having the swag", 75 - }, 76 - { 77 - Artist: &loudar, 78 - Role: "having the swag", 79 - }, 80 - }, 81 - Lyrics: 82 - `(call me when you fall asleep) 83 - (all in, let me ride the wave) 84 - 85 - (okay!) 86 - 87 - call me 88 - when you fall asleep 89 - (fall asleep, call on me) 90 - (oh babe, why don'cha) 91 - yeah, it's how you feel 92 - when the stars come out 93 - (you're never gonna get it) 94 - (while you've lost yourself in a rut) 95 - all in 96 - let me ride the wave 97 - (i'm so stressed) 98 - (i need to fly out of this place) 99 - yeah, 'cause we can drift 100 - 'til the break of dawn 101 - (i think i'll be okay) 102 - (if i can sleep today) 103 - 104 - (switch it up!) 105 - 106 - slumber party at 2AM 107 - could think of nothing more perfect 108 - than a moonlight jam 109 - 110 - yeah, i've got no sleep 111 - but I'm free today 112 - yeah you could even say 113 - that i'm free2play 114 - 115 - you ain't here by my side 116 - and i try to get by 117 - with my head out the window 118 - get a listen of this 119 - 120 - the whispers of the trees 121 - the crickets do be chirpin' 122 - i guess that's how it goes 123 - 124 - (call me when you fall asleep) 125 - (all in, let me ride the wave) 126 - 127 - (let's go!) 128 - 129 - call me 130 - when you fall asleep 131 - (fall asleep, call on me) 132 - (oh babe, why don'cha) 133 - yeah, it's how you feel 134 - when the stars come out 135 - (you're never gonna get it) 136 - (while you've lost yourself in a rut) 137 - all in 138 - let me ride the wave 139 - (i'm so stressed) 140 - (i need to fly out of this place) 141 - yeah, 'cause we can drift 142 - 'til the break of dawn 143 - (i think i'll be okay) 144 - (if i can sleep today) 145 - 146 - yeah... woo! 147 - (BASS) 148 - oh man... 149 - i'm just sitting here 150 - feeling the breeze 151 - hanging out 152 - listening to the crickets 153 - and the trees in the breeze 154 - living my best life`, 155 - }, 156 - // { 157 - // Id: "free2play", 158 - // Title: "free2play", 159 - // Type: "upcoming", 160 - // ReleaseDate: make_date_work("17-Mar-2024"), 161 - // Buyname: "pre-order", 162 - // Buylink: "https://arimelody.me/", 163 - // Description: "hello from your local SPACEGIRL! 💫", 164 - // Credits: []AlbumCredit{ 165 - // AlbumCredit{ 166 - // Artist: &ari, 167 - // Role: "vocals", 168 - // }, 169 - // AlbumCredit{ 170 - // Artist: &ari, 171 - // Role: "production", 172 - // }, 173 - // AlbumCredit{ 174 - // Artist: &ari, 175 - // Role: "artwork", 176 - // }, 177 - // }, 178 - // }, 179 - { 180 - Id: "dream", 181 - Title: "Dream", 182 - Type: "single", 183 - ReleaseDate: make_date_work("11-Nov-2022"), 184 - Artwork: "https://mellodoot.com/img/music_artwork/mellodoot_-_Dream.webp", 185 - Buylink: "https://arimelody.bandcamp.com/track/dream", 186 - Links: []MusicLink{ 187 - { 188 - Name: "spotify", 189 - Url: "https://open.spotify.com/album/5talRpqzjExP1w6j5LFIAh", 190 - }, 191 - { 192 - Name: "apple music", 193 - Url: "https://music.apple.com/ie/album/dream-single/1650037132", 194 - }, 195 - { 196 - Name: "soundcloud", 197 - Url: "https://soundcloud.com/arimelody/dream2022", 198 - }, 199 - { 200 - Name: "youtube", 201 - Url: "https://www.youtube.com/watch?v=nfFgtMuYAx8", 202 - }, 203 - }, 204 - Description: "living the dream 🌌 ✨", 205 - Credits: []MusicCredit{ 206 - { 207 - Artist: &mellodoot, 208 - Role: "vocals", 209 - }, 210 - { 211 - Artist: &mellodoot, 212 - Role: "production", 213 - }, 214 - { 215 - Artist: &mellodoot, 216 - Role: "artwork", 217 - }, 218 - }, 219 - Lyrics: 220 - `the truth is what you make of it 221 - in the end, what you spend, is the end of it 222 - when you're lost in the life 223 - the life that you created on your own 224 - i'm becoming one 225 - with the soul that i see in the mirror 226 - blending one and whole 227 - this time, i'm real 228 - 229 - i'm living the dream 230 - i'm living my best life 231 - running out of time 232 - i gotta make this right 233 - whenever you rise 234 - whenever you come down 235 - fall away from the light 236 - and then fall into our arms 237 - 238 - the truth is what you make of it 239 - in the end, what you spend, is the end of it 240 - when you're lost in the life 241 - the life that you created on your own 242 - i'm becoming one 243 - with the soul that i see in the mirror 244 - blending one and whole 245 - this time, i'm real`, 246 - }, 247 - { 248 - Id: "gomyway", 249 - Title: "Go My Way", 250 - Type: "single", 251 - ReleaseDate: make_date_work("24-Jan-2021"), 252 - Artwork: "https://mellodoot.com/img/music_artwork/mellodoot_-_Go_My_Way.webp", 253 - Buylink: "https://arimelody.bandcamp.com/track/go-my-way", 254 - Links: []MusicLink{ 255 - { 256 - Name: "spotify", 257 - Url: "https://open.spotify.com/album/35WNtxK12IDHCUoXHDePGE", 258 - }, 259 - { 260 - Name: "apple music", 261 - Url: "https://music.apple.com/ie/album/go-my-way-single/1547145699", 262 - }, 263 - { 264 - Name: "soundcloud", 265 - Url: "https://soundcloud.com/arimelody/go-my-way", 266 - }, 267 - { 268 - Name: "youtube", 269 - Url: "https://www.youtube.com/watch?v=CNptNQdLkl0", 270 - }, 271 - }, 272 - Description: "hey! go my way! 💥 ✨", 273 - Credits: []MusicCredit{ 274 - { 275 - Artist: &mellodoot, 276 - Role: "vocals", 277 - }, 278 - { 279 - Artist: &mellodoot, 280 - Role: "production", 281 - }, 282 - { 283 - Artist: &mellodoot, 284 - Role: "artwork", 285 - }, 286 - }, 287 - }, 288 - { 289 - Id: "rowboat", 290 - Title: "Rowboat", 291 - Type: "single", 292 - ReleaseDate: make_date_work("12-Mar-2020"), 293 - Artwork: "https://mellodoot.com/img/music_artwork/mellodoot_-_Rowboat.webp", 294 - Buylink: "https://arimelody.bandcamp.com/track/rowboat", 295 - Links: []MusicLink{ 296 - { 297 - Name: "spotify", 298 - Url: "https://open.spotify.com/album/7jyqJFVKaENCPm58v5O44Y", 299 - }, 300 - { 301 - Name: "apple music", 302 - Url: "https://music.apple.com/ie/album/rowboat-single/1502608714", 303 - }, 304 - { 305 - Name: "soundcloud", 306 - Url: "https://soundcloud.com/arimelody/rowboat", 307 - }, 308 - { 309 - Name: "youtube", 310 - Url: "https://www.youtube.com/watch?v=uOQyILDTzME", 311 - }, 312 - }, 313 - Description: "let's take a trip. i've got a goddamn boat ⛵️", 314 - Credits: []MusicCredit{ 315 - { 316 - Artist: &mellodoot, 317 - Role: "vocals", 318 - }, 319 - { 320 - Artist: &mellodoot, 321 - Role: "production", 322 - }, 323 - { 324 - Artist: &mellodoot, 325 - Role: "artwork", 326 - }, 327 - }, 328 - }, 329 - { 330 - Id: "helloworld", 331 - Title: "Hello World", 332 - Type: "single", 333 - ReleaseDate: make_date_work("25-Dec-2019"), 334 - Artwork: "https://mellodoot.com/img/music_artwork/mellodoot_-_Hello_World.webp", 335 - Buylink: "https://arimelody.bandcamp.com/track/hello-world", 336 - Links: []MusicLink{ 337 - { 338 - Name: "spotify", 339 - Url: "https://open.spotify.com/album/3LbElPXD4dsDumttGBuYxx", 340 - }, 341 - { 342 - Name: "apple music", 343 - Url: "https://music.apple.com/ie/album/hello-world-single/1491880155", 344 - }, 345 - { 346 - Name: "soundcloud", 347 - Url: "https://soundcloud.com/arimelody/helloworld", 348 - }, 349 - { 350 - Name: "youtube", 351 - Url: "https://www.youtube.com/watch?v=CQhlRsl0Mjk", 352 - }, 353 - }, 354 - Description: "we'll dawn a new frontier! 👾", 355 - Credits: []MusicCredit{ 356 - { 357 - Artist: &mellodoot, 358 - Role: "vocals", 359 - }, 360 - { 361 - Artist: &mellodoot, 362 - Role: "production", 363 - }, 364 - { 365 - Artist: &mellodoot, 366 - Role: "artwork", 367 - }, 368 - }, 369 - }, 370 - { 371 - Id: "sine", 372 - Title: "Sine", 373 - Type: "single", 374 - ReleaseDate: make_date_work("07-Dec-2019"), 375 - Artwork: "https://mellodoot.com/img/music_artwork/zaire_-_Sine_ft._mellodoot.webp", 376 - Links: []MusicLink{ 377 - { 378 - Name: "spotify", 379 - Url: "https://open.spotify.com/album/4WPuaJtTV7z86KubD9Rnmk", 380 - }, 381 - { 382 - Name: "apple music", 383 - Url: "https://music.apple.com/us/album/sine-feat-mellodoot/1489163020", 384 - }, 385 - { 386 - Name: "youtube", 387 - Url: "https://www.youtube.com/watch?v=z1H1s6VRnyY", 388 - }, 389 - }, 390 - Credits: []MusicCredit{ 391 - { 392 - Artist: &zaire, 393 - Role: "production", 394 - }, 395 - { 396 - Artist: &mellodoot, 397 - Role: "production", 398 - }, 399 - }, 400 - }, 401 - { 402 - Id: "10", 403 - Title: "10", 404 - Type: "single", 405 - ReleaseDate: make_date_work("29-Sep-2019"), 406 - Artwork: "https://mellodoot.com/img/music_artwork/mellodoot_-_10.webp", 407 - Buylink: "https://arimelody.bandcamp.com/track/10", 408 - Links: []MusicLink{ 409 - { 410 - Name: "spotify", 411 - Url: "https://open.spotify.com/album/2x4gbACfDm99unaXpLXyj0", 412 - }, 413 - { 414 - Name: "apple music", 415 - Url: "https://music.apple.com/ie/album/ten-single/1483193041", 416 - }, 417 - { 418 - Name: "soundcloud", 419 - Url: "https://soundcloud.com/arimelody/ten", 420 - }, 421 - { 422 - Name: "youtube", 423 - Url: "https://www.youtube.com/watch?v=C7WP5L2BK4U", 424 - }, 425 - }, 426 - Credits: []MusicCredit{ 427 - { 428 - Artist: &mellodoot, 429 - Role: "production", 430 - }, 431 - { 432 - Artist: &mellodoot, 433 - Role: "artwork", 434 - }, 435 - }, 436 - }, 437 - { 438 - Id: "mad", 439 - Title: "MAD", 440 - Type: "single", 441 - ReleaseDate: make_date_work("03-Nov-2018"), 442 - Artwork: "https://mellodoot.com/img/music_artwork/mellodoot_-_MAD.webp", 443 - Buylink: "https://arimelody.bandcamp.com/track/mad", 444 - Links: []MusicLink{ 445 - { 446 - Name: "spotify", 447 - Url: "https://open.spotify.com/album/59nFXw1WNoRhXou7lXqBZd", 448 - }, 449 - { 450 - Name: "apple music", 451 - Url: "https://music.apple.com/ie/album/mad/1441233120", 452 - }, 453 - { 454 - Name: "soundcloud", 455 - Url: "https://soundcloud.com/arimelody/mad", 456 - }, 457 - { 458 - Name: "youtube", 459 - Url: "https://www.youtube.com/watch?v=OB-Pk6p6mfQ", 460 - }, 461 - }, 462 - Credits: []MusicCredit{ 463 - { 464 - Artist: &mellodoot, 465 - Role: "vocals", 466 - }, 467 - { 468 - Artist: &mellodoot, 469 - Role: "production", 470 - }, 471 - { 472 - Artist: &mellodoot, 473 - Role: "artwork", 474 - }, 475 - }, 476 - }, 477 - { 478 - Id: "welcomingparty", 479 - Title: "Welcoming Party", 480 - Type: "album", 481 - ReleaseDate: make_date_work("01-Nov-2018"), 482 - Artwork: "https://mellodoot.com/img/music_artwork/mellodoot_-_Welcoming_Party.webp", 483 - Buylink: "https://arimelody.bandcamp.com/album/welcoming-party", 484 - Links: []MusicLink{ 485 - { 486 - Name: "spotify", 487 - Url: "https://open.spotify.com/album/3EPa4HZpkISQVRAks64LfR", 488 - }, 489 - { 490 - Name: "apple music", 491 - Url: "https://music.apple.com/ie/album/welcoming-party-ep/1441161424", 492 - }, 493 - { 494 - Name: "soundcloud", 495 - Url: "https://soundcloud.com/arimelody/sets/welcoming-party", 496 - }, 497 - { 498 - Name: "youtube", 499 - Url: "https://www.youtube.com/playlist?list=PLBG_QJeOHrB5EeniiXBIlHpoQbD6CUJca", 500 - }, 501 - }, 502 - Credits: []MusicCredit{ 503 - { 504 - Artist: &mellodoot, 505 - Role: "production", 506 - }, 507 - { 508 - Artist: &mellodoot, 509 - Role: "artwork", 510 - }, 511 - }, 512 - // "tracks": [ 513 - // { 514 - // "title": "Paradigm" 515 - // }, 516 - // { 517 - // "title": "Mitrio" 518 - // }, 519 - // { 520 - // "title": "Level One" 521 - // }, 522 - // { 523 - // "title": "Cubes" 524 - // }, 525 - // { 526 - // "title": "Aria" 527 - // } 528 - // ] 529 - }, 530 - { 531 - Id: "howtheyknow2018", 532 - Title: "How They Know (2018)", 533 - Type: "single", 534 - ReleaseDate: make_date_work("27-Feb-2018"), 535 - Artwork: "https://mellodoot.com/img/music_artwork/mellodoot_-_How_They_Know_2018.webp", 536 - Buyname: "free download", 537 - Buylink: "https://arimelody.bandcamp.com/track/how-they-know-2018-remastered", 538 - Links: []MusicLink{ 539 - { 540 - Name: "soundcloud", 541 - Url: "https://soundcloud.com/arimelody/how-they-know-2018", 542 - }, 543 - { 544 - Name: "youtube", 545 - Url: "https://www.youtube.com/watch?v=mbAgSwCzyMw", 546 - }, 547 - }, 548 - Credits: []MusicCredit{ 549 - { 550 - Artist: &mellodoot, 551 - Role: "production", 552 - }, 553 - { 554 - Artist: &red, 555 - Role: "artwork", 556 - Meta: true, 557 - }, 558 - }, 559 - }, 560 - { 561 - Id: "howtheyknow", 562 - Title: "How They Know", 563 - Type: "single", 564 - ReleaseDate: make_date_work("29-Nov-2017"), 565 - Artwork: "https://mellodoot.com/img/music_artwork/mellodoot_-_How_They_Know.webp", 566 - Buyname: "free download", 567 - Buylink: "https://arimelody.bandcamp.com/track/how-they-know", 568 - Links: []MusicLink{ 569 - { 570 - Name: "soundcloud", 571 - Url: "https://soundcloud.com/arimelody/how-they-know", 572 - }, 573 - { 574 - Name: "youtube", 575 - Url: "https://www.youtube.com/watch?v=q6lzKuG1Emo", 576 - }, 577 - }, 578 - Credits: []MusicCredit{ 579 - { 580 - Artist: &mellodoot, 581 - Role: "production", 582 - }, 583 - { 584 - Artist: &red, 585 - Role: "artwork", 586 - Meta: true, 587 - }, 588 - }, 589 - }, 590 - { 591 - Id: "traveller", 592 - Title: "Traveller", 593 - Type: "single", 594 - ReleaseDate: make_date_work("24-Sep-2017"), 595 - Artwork: "https://mellodoot.com/img/music_artwork/mellodoot_-_Traveller.webp", 596 - Buyname: "free download", 597 - Buylink: "https://arimelody.bandcamp.com/track/traveller", 598 - Links: []MusicLink{ 599 - { 600 - Name: "soundcloud", 601 - Url: "https://soundcloud.com/arimelody/traveller", 602 - }, 603 - { 604 - Name: "youtube", 605 - Url: "https://www.youtube.com/watch?v=ZTO7IQZ-yXA", 606 - }, 607 - }, 608 - Description: "an 8-bit expedition! ⚔️🛡️", 609 - Credits: []MusicCredit{ 610 - { 611 - Artist: &mellodoot, 612 - Role: "production", 613 - }, 614 - { 615 - Artist: &mellodoot, 616 - Role: "artwork", 617 - }, 618 - }, 619 - }, 620 15 } 621 16 622 17 func GetRelease(id string) (MusicRelease, bool) {
+161
api/v1/music/music_placeholders.go
··· 1 + package music 2 + 3 + var ari = Artist{ 4 + Id: "arimelody", 5 + Name: "ari melody", 6 + Website: "https://arimelody.me", 7 + } 8 + var mellodoot = Artist{ 9 + Id: "mellodoot", 10 + Name: "mellodoot", 11 + Website: "https://mellodoot.com", 12 + } 13 + var zaire = Artist{ 14 + Id: "zaire", 15 + Name: "zaire", 16 + Website: "https://supitszaire.com", 17 + } 18 + var mae = Artist{ 19 + Id: "maetaylor", 20 + Name: "mae taylor", 21 + Website: "https://mae.wtf", 22 + } 23 + var loudar = Artist{ 24 + Id: "loudar", 25 + Name: "Loudar", 26 + Website: "https://alex.targoninc.com", 27 + } 28 + var red = Artist { 29 + Id: "smoljorb", 30 + Name: "smoljorb", 31 + } 32 + 33 + var placeholders = []MusicRelease{ 34 + { 35 + Id: "test", 36 + Title: "test album", 37 + Type: "album", 38 + ReleaseDate: make_date_work("18-Mar-2024"), 39 + Buyname: "go get it!!", 40 + Buylink: "https://arimelody.me/", 41 + Links: []MusicLink{ 42 + { 43 + Name: "youtube", 44 + Url: "https://youtu.be/dQw4w9WgXcQ", 45 + }, 46 + }, 47 + Description: 48 + `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.`, 49 + Credits: []MusicCredit{ 50 + { 51 + Artist: &ari, 52 + Role: "having the swag", 53 + }, 54 + { 55 + Artist: &zaire, 56 + Role: "having the swag", 57 + }, 58 + { 59 + Artist: &mae, 60 + Role: "having the swag", 61 + }, 62 + { 63 + Artist: &loudar, 64 + Role: "having the swag", 65 + }, 66 + }, 67 + Tracks: []MusicTrack{ 68 + { 69 + Number: 0, 70 + Title: "track 1", 71 + Description: "sample track description", 72 + Lyrics: "sample lyrics for track 1!", 73 + PreviewUrl: "https://mellodoot.com/audio/preview/dream.webm", 74 + }, 75 + { 76 + Number: 1, 77 + Title: "track 2", 78 + Description: "sample track description", 79 + Lyrics: "sample lyrics for track 2!", 80 + PreviewUrl: "https://mellodoot.com/audio/preview/dream.webm", 81 + }, 82 + }, 83 + }, 84 + { 85 + Id: "dream", 86 + Title: "Dream", 87 + Type: "single", 88 + ReleaseDate: make_date_work("11-Nov-2022"), 89 + Artwork: "https://mellodoot.com/img/music_artwork/mellodoot_-_Dream.webp", 90 + Buylink: "https://arimelody.bandcamp.com/track/dream", 91 + Links: []MusicLink{ 92 + { 93 + Name: "spotify", 94 + Url: "https://open.spotify.com/album/5talRpqzjExP1w6j5LFIAh", 95 + }, 96 + { 97 + Name: "apple music", 98 + Url: "https://music.apple.com/ie/album/dream-single/1650037132", 99 + }, 100 + { 101 + Name: "soundcloud", 102 + Url: "https://soundcloud.com/arimelody/dream2022", 103 + }, 104 + { 105 + Name: "youtube", 106 + Url: "https://www.youtube.com/watch?v=nfFgtMuYAx8", 107 + }, 108 + }, 109 + Description: "living the dream 🌌 ✨", 110 + Credits: []MusicCredit{ 111 + { 112 + Artist: &mellodoot, 113 + Role: "vocals", 114 + }, 115 + { 116 + Artist: &mellodoot, 117 + Role: "production", 118 + }, 119 + { 120 + Artist: &mellodoot, 121 + Role: "artwork", 122 + }, 123 + }, 124 + Tracks: []MusicTrack{ 125 + { 126 + Number: 0, 127 + Title: "Dream", 128 + Description: "no description here!", 129 + Lyrics: 130 + `the truth is what you make of it 131 + in the end, what you spend, is the end of it 132 + when you're lost in the life 133 + the life that you created on your own 134 + i'm becoming one 135 + with the soul that i see in the mirror 136 + blending one and whole 137 + this time, i'm real 138 + 139 + i'm living the dream 140 + i'm living my best life 141 + running out of time 142 + i gotta make this right 143 + whenever you rise 144 + whenever you come down 145 + fall away from the light 146 + and then fall into our arms 147 + 148 + the truth is what you make of it 149 + in the end, what you spend, is the end of it 150 + when you're lost in the life 151 + the life that you created on your own 152 + i'm becoming one 153 + with the soul that i see in the mirror 154 + blending one and whole 155 + this time, i'm real`, 156 + PreviewUrl: "https://mellodoot.com/audio/preview/dream.webm", 157 + }, 158 + }, 159 + }, 160 + } 161 +
+26 -62
api/v1/music/music_types.go
··· 24 24 Links []MusicLink 25 25 Description string 26 26 Credits []MusicCredit 27 - Lyrics string 27 + Tracks []MusicTrack 28 28 } 29 29 30 30 MusicLink struct { ··· 37 37 Role string 38 38 Meta bool // for "meta" contributors (i.e. not credited for the musical work, but other related assets) 39 39 } 40 - ) 41 40 42 - func (album MusicRelease) GetUniqueArtists() []Artist { 43 - if len(album.Credits) == 1 { 44 - return []Artist{*album.Credits[0].Artist} 41 + MusicTrack struct { 42 + Number int 43 + Title string 44 + Description string 45 + Lyrics string 46 + PreviewUrl string 45 47 } 48 + ) 46 49 47 - // create a map of artists to prevent duplicates 48 - res := []Artist{} 49 - for _, credit := range album.Credits { 50 - artist := *credit.Artist 51 - exists := false 52 - for _, c := range res { 53 - if c == *credit.Artist { 54 - exists = true 55 - break 56 - } 57 - } 58 - if exists { 50 + func (release MusicRelease) GetUniqueArtists(include_meta bool) []*Artist { 51 + res := []*Artist{} 52 + for _, credit := range release.Credits { 53 + if !include_meta && credit.Meta { 59 54 continue 60 55 } 61 - res = append(res, artist) 62 - } 63 56 64 - // now create the actual array to send 65 - return res 66 - } 67 - 68 - func (album MusicRelease) GetUniqueNonMetaArtists() []Artist { 69 - if len(album.Credits) == 1 { 70 - return []Artist{*album.Credits[0].Artist} 71 - } 72 - 73 - // create a map of artists to prevent duplicates 74 - res := []Artist{} 75 - for _, credit := range album.Credits { 76 - if credit.Meta { 77 - continue 78 - } 79 - artist := *credit.Artist 80 57 exists := false 81 - for _, c := range res { 82 - if c == *credit.Artist { 58 + for _, a := range res { 59 + if a == credit.Artist { 83 60 exists = true 84 61 break 85 62 } ··· 87 64 if exists { 88 65 continue 89 66 } 90 - res = append(res, artist) 67 + 68 + res = append(res, credit.Artist) 91 69 } 92 70 93 71 // now create the actual array to send 94 72 return res 95 73 } 96 74 97 - func (album MusicRelease) GetUniqueArtistNames() []string { 98 - if len(album.Credits) == 1 { 99 - return []string{album.Credits[0].Artist.Name} 100 - } 101 - 102 - artists := album.GetUniqueArtists() 103 - names := []string{} 104 - for _, artist := range artists { 105 - names = append(names, artist.Name) 106 - } 107 - 108 - return names 109 - } 110 - 111 - func (album MusicRelease) GetUniqueNonMetaArtistNames() []string { 112 - if len(album.Credits) == 1 { 113 - return []string{album.Credits[0].Artist.Name} 114 - } 115 - 116 - artists := album.GetUniqueNonMetaArtists() 75 + func (release MusicRelease) GetUniqueArtistNames(include_meta bool) []string { 76 + artists := release.GetUniqueArtists(include_meta) 117 77 names := []string{} 118 78 for _, artist := range artists { 119 79 names = append(names, artist.Name) ··· 122 82 return names 123 83 } 124 84 125 - func (album MusicRelease) PrintPrimaryArtists() string { 126 - names := album.GetUniqueNonMetaArtistNames() 85 + func (album MusicRelease) PrintPrimaryArtists(include_meta bool) string { 86 + names := album.GetUniqueArtistNames(include_meta) 127 87 if len(names) == 1 { 128 88 return names[0] 129 89 } ··· 132 92 return res 133 93 } 134 94 135 - func (album MusicRelease) PrintCommaPrimaryArtists() string { 136 - names := album.GetUniqueNonMetaArtistNames() 95 + func (album MusicRelease) PrintCommaPrimaryArtists(include_meta bool) string { 96 + names := album.GetUniqueArtistNames(include_meta) 137 97 if len(names) == 1 { 138 98 return names[0] 139 99 } ··· 165 125 func (link MusicLink) NormaliseName() string { 166 126 re := regexp.MustCompile(`[^a-z0-9]`) 167 127 return strings.ToLower(re.ReplaceAllString(link.Name, "")) 128 + } 129 + 130 + func (release MusicRelease) IsSingle() bool { 131 + return len(release.Tracks) == 1; 168 132 } 169 133 170 134 func (credit MusicCredit) ResolveArtist() Artist {
+25 -12
db.go
··· 25 25 release_date DATE NOT NULL, 26 26 artwork TEXT, 27 27 buyname TEXT, 28 - buylink TEXT, 29 - description TEXT, 30 - lyrics TEXT 28 + buylink TEXT 31 29 ); 32 30 33 31 CREATE TABLE IF NOT EXISTS musiclinks ( 34 - album VARCHAR(64) REFERENCES musicreleases(id) ON DELETE CASCADE ON UPDATE CASCADE, 32 + release VARCHAR(64) REFERENCES musicreleases(id) ON DELETE CASCADE ON UPDATE CASCADE, 35 33 name TEXT, 36 34 url TEXT, 37 - CONSTRAINT musiclinks_pk PRIMARY KEY (album, name) 35 + CONSTRAINT musiclinks_pk PRIMARY KEY (release, name) 38 36 ); 39 37 40 38 CREATE TABLE IF NOT EXISTS musiccredits ( 41 - album VARCHAR(64) REFERENCES musicreleases(ID) ON DELETE CASCADE, 39 + release VARCHAR(64) REFERENCES musicreleases(ID) ON DELETE CASCADE, 42 40 artist TEXT REFERENCES artists(id) ON DELETE CASCADE, 43 41 role TEXT, 44 42 meta BOOLEAN, 45 - constraint musiccredits_pk PRIMARY KEY (album, artist, role) 43 + constraint musiccredits_pk PRIMARY KEY (release, artist) 44 + ); 45 + 46 + CREATE TABLE IF NOT EXISTS musictracks ( 47 + release VARCHAR(64) REFERENCES musicreleases(ID) ON DELETE CASCADE, 48 + number INT NOT NULL, 49 + title TEXT NOT NULL, 50 + description TEXT, 51 + lyrics TEXT, 52 + preview_url TEXT, 53 + CONSTRAINT musictracks_pk PRIMARY KEY (release, number) 46 54 );` 47 55 48 56 func PushArtist(db *sqlx.DB, artist music.Artist) { ··· 61 69 fmt.Printf("syncing release [%s] to database...", release.Id) 62 70 63 71 tx := db.MustBegin() 64 - tx.MustExec("INSERT INTO musicreleases (id, title, release_date, artwork, buyname, buylink, description, lyrics) VALUES ($1, $2, $3, $4, $5, $6, $7, $8) "+ 65 - "ON CONFLICT (id) DO UPDATE SET title=$2, release_date=$3, artwork=$4, buyname=$5, buylink=$6, description=$7, lyrics=$8", 66 - &release.Id, &release.Title, release.ReleaseDate.Format("2-Jan-2006"), &release.Artwork, &release.Buyname, &release.Buylink, &release.Description, &release.Lyrics) 72 + tx.MustExec("INSERT INTO musicreleases (id, title, type, release_date, artwork, buyname, buylink) VALUES ($1, $2, $3, $4, $5, $6, $7) "+ 73 + "ON CONFLICT (id) DO UPDATE SET title=$2, type=$3, release_date=$4, artwork=$5, buyname=$6, buylink=$7", 74 + &release.Id, &release.Title, &release.Type, release.ReleaseDate.Format("2-Jan-2006"), &release.Artwork, &release.Buyname, &release.Buylink) 67 75 68 76 for _, link := range release.Links { 69 - tx.MustExec("INSERT INTO musiclinks (album, name, url) VALUES ($1, $2, $3) ON CONFLICT (album, name) DO UPDATE SET url=$3", 77 + tx.MustExec("INSERT INTO musiclinks (release, name, url) VALUES ($1, $2, $3) ON CONFLICT (release, name) DO UPDATE SET url=$3", 70 78 &release.Id, &link.Name, &link.Url) 71 79 } 72 80 for _, credit := range release.Credits { 73 - tx.MustExec("INSERT INTO musiccredits (album, artist, role, meta) VALUES ($1, $2, $3, $4) ON CONFLICT DO NOTHING", 81 + tx.MustExec("INSERT INTO musiccredits (release, artist, role, meta) VALUES ($1, $2, $3, $4) ON CONFLICT DO NOTHING", 74 82 &release.Id, &credit.Artist.Id, &credit.Role, &credit.Meta) 83 + } 84 + for _, track := range release.Tracks { 85 + tx.MustExec("INSERT INTO musictracks (release, number, title, description, lyrics, preview_url) VALUES ($1, $2, $3, $4, $5, $6) "+ 86 + "ON CONFLICT (release, number) DO UPDATE SET title=$3, description=$4, lyrics=$5, preview_url=$6", 87 + &release.Id, &track.Number, &track.Title, &track.Description, &track.Lyrics, &track.PreviewUrl) 75 88 } 76 89 77 90 tx.Commit()
+21
public/style/main.css
··· 34 34 text-decoration: underline; 35 35 } 36 36 37 + a.link-button { 38 + padding: .3em .5em; 39 + border: 1px solid var(--links); 40 + color: var(--links); 41 + border-radius: 2px; 42 + background-color: transparent; 43 + transition-property: color, border-color, background-color; 44 + transition-duration: .2s; 45 + animation-delay: 0s; 46 + animation: list-item-fadein .2s forwards; 47 + opacity: 0; 48 + } 49 + 50 + a.link-button:hover { 51 + color: #eee; 52 + border-color: #eee; 53 + background-color: var(--links) !important; 54 + text-decoration: none; 55 + box-shadow: 0 0 1em var(--links); 56 + } 57 + 37 58 small { 38 59 font-size: 1em; 39 60 color: #aaa;
+43 -102
public/style/music-gateway.css
··· 358 358 font-size: 1.2em; 359 359 } 360 360 361 + #share { 362 + margin: 0; 363 + display: inline-block; 364 + line-height: 1em; 365 + text-shadow: 0 .05em 2px #0004; 366 + cursor: pointer; 367 + opacity: .5; 368 + transition: opacity .1s linear; 369 + } 370 + 371 + #share:hover { 372 + opacity: 1; 373 + } 374 + 375 + #share.active { 376 + animation: share-click .5s forwards 377 + } 378 + 379 + #share.active::after { 380 + content: "✓"; 381 + position: relative; 382 + left: .2em; 383 + font-size: 1.2em; 384 + line-height: 1em; 385 + animation: share-after 2s cubic-bezier(.5,0,1,.5) forwards 386 + } 387 + 361 388 div#extras ul { 362 389 height: 100%; 363 390 display: flex; ··· 388 415 color: #eee; 389 416 } 390 417 391 - a.scrollback { 392 - color: #888; 393 - font-style: italic; 394 - } 395 - 396 418 #credits ul { 397 419 list-style: "> "; 398 420 } ··· 401 423 margin-bottom: 1rem; 402 424 } 403 425 404 - #share { 405 - margin: 0; 406 - display: inline-block; 407 - line-height: 1em; 408 - text-shadow: 0 .05em 2px #0004; 409 - cursor: pointer; 410 - opacity: .5; 411 - transition: opacity .1s linear; 426 + #tracks ul { 427 + padding: 0; 428 + list-style: none; 412 429 } 413 430 414 - #share:hover { 415 - opacity: 1; 431 + #tracks ul li { 432 + margin-bottom: .5rem; 433 + padding: 1rem; 434 + background-color: #0008; 435 + cursor: pointer; 436 + transition: background-color .1s linear; 416 437 } 417 438 418 - #share.active { 419 - animation: share-click .5s forwards 439 + #tracks ul li:hover { 440 + background-color: #2228; 420 441 } 421 442 422 - #share.active::after { 423 - content: "✓"; 424 - position: relative; 425 - left: .2em; 426 - font-size: 1.2em; 427 - line-height: 1em; 428 - animation: share-after 2s cubic-bezier(.5,0,1,.5) forwards 443 + #tracks ul li:active { 444 + background-color: #4448; 429 445 } 430 446 431 - #tracks { 432 - flex-basis: 100%; 433 - max-height: 10rem; 434 - margin: auto 8rem; 435 - display: flex; 436 - flex-wrap: wrap; 437 - gap: 0 2rem; 438 - overflow-y: auto; 439 - scrollbar-color: #fff transparent; 440 - scrollbar-width: thin 441 - } 442 - 443 - #tracks .track-preview { 444 - width: 100%; 445 - height: 2.5rem; 446 - display: flex; 447 - flex-direction: row; 448 - border-bottom: 1px solid #fff2; 449 - border-radius: 4px; 450 - user-select: none; 451 - transition: background-color .2s,color .2s 452 - } 453 - 454 - #tracks .track-preview: last-of-type { 455 - border-bottom: none 456 - } 457 - 458 - .track-preview:hover { 459 - background-color: #0002 460 - } 461 - 462 - .track-preview.playing { 463 - color: #111; 464 - background-color: #fff 465 - } 466 - 467 - .track-preview i { 468 - width: .7em; 469 - margin: auto .8em; 470 - pointer-events: none 471 - } 472 - 473 - .track-preview p { 474 - margin: auto 0; 475 - display: inline-block; 476 - line-height: 2em; 477 - font-size: 1em; 478 - pointer-events: none 479 - } 480 - 481 - .track-preview audio { 482 - width: 100% 447 + #tracks ul li.active { 448 + color: #000; 449 + background-color: var(--primary); 483 450 } 484 451 485 452 footer { ··· 509 476 footer a:hover { 510 477 text-decoration: underline 511 478 } 512 - 513 - /* 514 - @media only screen and (min-width: 1105px) { 515 - div#music-container:not(:has(> div#info #credits:target)):not(:has(> div#info #lyrics:target)) { 516 - div#extras ul li:first-of-type a { 517 - color: #eee; 518 - } 519 - } 520 - 521 - div#music-container:has(> div#info #credits:target) { 522 - div#extras ul li a[href="#credits"] { 523 - color: #eee; 524 - } 525 - } 526 - 527 - div#music-container:has(> div#info #lyrics:target) { 528 - div#extras ul li a[href="#lyrics"] { 529 - color: #eee; 530 - } 531 - } 532 - } 533 - */ 534 479 535 480 @media only screen and (max-width: 1105px) { 536 481 main { ··· 617 562 618 563 #share.active: : after { 619 564 transform: translate(calc(-50% - .6em),1.5em); 620 - } 621 - 622 - #tracks { 623 - margin: 0; 624 565 } 625 566 626 567 footer {
+6 -1
public/style/music.css
··· 7 7 padding-top: 4rem; 8 8 } 9 9 10 + main nav { 11 + margin: -1rem .5rem 1rem .5rem; 12 + } 13 + 10 14 div.music { 11 15 margin-bottom: 1rem; 12 16 padding: 1.5rem; ··· 93 97 list-style: none; 94 98 } 95 99 100 + /* 96 101 .music-links li a { 97 102 padding: .2em .5em; 98 103 border: 1px solid #65b4fd; ··· 106 111 opacity: 0; 107 112 } 108 113 109 - 110 114 .music-links li a:hover { 111 115 color: #eee; 112 116 border-color: #eee; 113 117 background-color: var(--links) !important; 114 118 text-decoration: none; 115 119 } 120 + */ 116 121 117 122 h2.question { 118 123 margin: 1rem 0;
+35 -18
views/music-gateway.html
··· 1 1 {{define "head"}} 2 - <title>{{.PrintPrimaryArtists}} - {{.Title}}</title> 2 + <title>{{.PrintPrimaryArtists false}} - {{.Title}}</title> 3 3 <link rel="icon" href="{{.ResolveArtwork}}"> 4 4 5 - <meta name="description" content="Stream &quot;{{.Title}}&quot; by {{.PrintPrimaryArtists}} on all platforms!"> 6 - <meta name="author" content="{{.PrintPrimaryArtists}}"> 7 - <meta name="keywords" content="{{.PrintCommaPrimaryArtists}}, music, {{.Title}}, {{.Id}}, {{.GetReleaseYear}}"> 5 + <meta name="description" content="Stream &quot;{{.Title}}&quot; by {{.PrintPrimaryArtists false}} on all platforms!"> 6 + <meta name="author" content="{{.PrintPrimaryArtists false}}"> 7 + <meta name="keywords" content="{{.PrintCommaPrimaryArtists false}}, music, {{.Title}}, {{.Id}}, {{.GetReleaseYear}}"> 8 8 9 9 <meta property="og:url" content="https://arimelody.me/music/{{.Id}}"> 10 10 <meta property="og:type" content="website"> 11 11 <meta property="og:locale" content="en_IE"> 12 12 <meta property="og:site_name" content="ari melody music"> 13 - <meta property="og.Title" content="{{.PrintPrimaryArtists}} - {{.Title}}"> 14 - <meta property="og:description" content="Stream &quot;{{.Title}}&quot; by {{.PrintPrimaryArtists}} on all platforms!"> 13 + <meta property="og.Title" content="{{.PrintPrimaryArtists false}} - {{.Title}}"> 14 + <meta property="og:description" content="Stream &quot;{{.Title}}&quot; by {{.PrintPrimaryArtists false}} on all platforms!"> 15 15 <meta property="og:image" content="https://arimelody.me{{.ResolveArtwork}}"> 16 16 17 17 <meta name="twitter:card" content="summary_large_image"> ··· 19 19 <meta name="twitter:creator" content="@funniduck"> 20 20 <meta property="twitter:domain" content="arimelody.me"> 21 21 <meta property="twitter:url" content="https://arimelody.me/music/{{.Id}}"> 22 - <meta name="twitter.Title" content="{{.PrintPrimaryArtists}} - {{.Title}}"> 22 + <meta name="twitter.Title" content="{{.PrintPrimaryArtists false}} - {{.Title}}"> 23 23 <meta name="twitter:description" content="Stream &quot;{{.Title}}&quot; by mellodoot on all platforms!"> 24 24 <meta name="twitter:image" content="https://arimelody.me{{.ResolveArtwork}}"> 25 25 <meta name="twitter:image:alt" content="Cover art for &quot;{{.Title}}&quot;"> ··· 54 54 <h1 id="title">{{.Title}}</h1> 55 55 <span id="year" title="{{.PrintReleaseDate}}">{{.GetReleaseYear}}</span> 56 56 </div> 57 - <p id="artist">{{.PrintPrimaryArtists}}</p> 57 + <p id="artist">{{.PrintPrimaryArtists false}}</p> 58 58 <p id="type" class="{{.ResolveType}}">{{.ResolveType}}</p> 59 59 60 60 <ul id="links"> ··· 96 96 </div> 97 97 {{end}} 98 98 99 - <!-- {{if .Lyrics}} --> 100 - <!-- <div id="lyrics"> --> 101 - <!-- <h2>lyrics:</h2> --> 102 - <!-- <p>{{.Lyrics}}</p> --> 103 - <!-- </div> --> 104 - <!-- {{end}} --> 99 + {{if .IsSingle}} 100 + {{$Track := index .Tracks 0}} 101 + {{if $Track.Lyrics}} 102 + <div id="lyrics"> 103 + <h2>lyrics:</h2> 104 + <p>{{$Track.Lyrics}}</p> 105 + </div> 106 + {{end}} 107 + {{else}} 108 + <div id="tracks"> 109 + <h2>tracks:</h2> 110 + <ul> 111 + {{range .Tracks}} 112 + <li>{{.Title}}</li> 113 + {{end}} 114 + </ul> 115 + </div> 116 + {{end}} 105 117 </div> 106 118 107 - {{if or .Credits .Lyrics}} 119 + {{if or .Credits not .IsSingle}} 108 120 <div id="extras"> 109 121 <ul> 110 122 <li><a href="#overview">overview</a></li> ··· 113 125 <li><a href="#credits">credits</a></li> 114 126 {{end}} 115 127 116 - <!-- {{if .Lyrics}} --> 117 - <!-- <li><a href="#lyrics">lyrics</a></li> --> 118 - <!-- {{end}} --> 128 + {{if .IsSingle}} 129 + {{$Track := index .Tracks 0}} 130 + {{if $Track.Lyrics}} 131 + <li><a href="#lyrics">lyrics</a></li> 132 + {{end}} 133 + {{else}} 134 + <li><a href="#tracks">tracks</a></li> 135 + {{end}} 119 136 </ul> 120 137 </div> 121 138 {{end}}
+2 -2
views/music.html
··· 29 29 </div> 30 30 <div class="music-details" hx-boost="true" hx-target="main" hx-swap="outerHTML"> 31 31 <a href="/music/{{$Album.Id}}"><h1 class="music-title">{{$Album.Title}}</h1></a> 32 - <h2 class="music-artist">{{$Album.PrintPrimaryArtists}}</h2> 32 + <h2 class="music-artist">{{$Album.PrintPrimaryArtists false}}</h2> 33 33 <h3 class="music-type-{{.ResolveType}}">{{$Album.ResolveType}}</h3> 34 34 <ul class="music-links"> 35 35 {{range $Link := $Album.Links}} 36 36 <li> 37 - <a href="{{$Link.Url}}">{{$Link.Name}}</a> 37 + <a href="{{$Link.Url}}" class="link-button">{{$Link.Name}}</a> 38 38 </li> 39 39 {{end}} 40 40 </ul>