···55 "time"
66)
7788-var ari = Artist{
99- Id: "arimelody",
1010- Name: "ari melody",
1111- Website: "https://arimelody.me",
1212-}
1313-var mellodoot = Artist{
1414- Id: "mellodoot",
1515- Name: "mellodoot",
1616- Website: "https://mellodoot.com",
1717-}
1818-var zaire = Artist{
1919- Id: "zaire",
2020- Name: "zaire",
2121- Website: "https://supitszaire.com",
2222-}
2323-var mae = Artist{
2424- Id: "maetaylor",
2525- Name: "mae taylor",
2626- Website: "https://mae.wtf",
2727-}
2828-var loudar = Artist{
2929- Id: "loudar",
3030- Name: "Loudar",
3131- Website: "https://alex.targoninc.com",
3232-}
3333-var red = Artist {
3434- Id: "smoljorb",
3535- Name: "smoljorb",
3636-}
3737-388func make_date_work(date string) time.Time {
399 res, err := time.Parse("2-Jan-2006", date)
4010 if err != nil {
···4212 return time.Unix(0, 0)
4313 }
4414 return res
4545-}
4646-4747-var placeholders = []MusicRelease{
4848- {
4949- Id: "test",
5050- Title: "test album",
5151- // Type: "album",
5252- ReleaseDate: make_date_work("18-Mar-2024"),
5353- Buyname: "go get it!!",
5454- Buylink: "https://arimelody.me/",
5555- Links: []MusicLink{
5656- {
5757- Name: "youtube",
5858- Url: "https://youtu.be/dQw4w9WgXcQ",
5959- },
6060- },
6161- Description:
6262- `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.`,
6363- Credits: []MusicCredit{
6464- {
6565- Artist: &ari,
6666- Role: "having the swag",
6767- },
6868- {
6969- Artist: &zaire,
7070- Role: "having the swag",
7171- },
7272- {
7373- Artist: &mae,
7474- Role: "having the swag",
7575- },
7676- {
7777- Artist: &loudar,
7878- Role: "having the swag",
7979- },
8080- },
8181- Lyrics:
8282- `(call me when you fall asleep)
8383- (all in, let me ride the wave)
8484-8585- (okay!)
8686-8787- call me
8888- when you fall asleep
8989- (fall asleep, call on me)
9090- (oh babe, why don'cha)
9191- yeah, it's how you feel
9292- when the stars come out
9393- (you're never gonna get it)
9494- (while you've lost yourself in a rut)
9595- all in
9696- let me ride the wave
9797- (i'm so stressed)
9898- (i need to fly out of this place)
9999- yeah, 'cause we can drift
100100- 'til the break of dawn
101101- (i think i'll be okay)
102102- (if i can sleep today)
103103-104104- (switch it up!)
105105-106106- slumber party at 2AM
107107- could think of nothing more perfect
108108- than a moonlight jam
109109-110110- yeah, i've got no sleep
111111- but I'm free today
112112- yeah you could even say
113113- that i'm free2play
114114-115115- you ain't here by my side
116116- and i try to get by
117117- with my head out the window
118118- get a listen of this
119119-120120- the whispers of the trees
121121- the crickets do be chirpin'
122122- i guess that's how it goes
123123-124124- (call me when you fall asleep)
125125- (all in, let me ride the wave)
126126-127127- (let's go!)
128128-129129- call me
130130- when you fall asleep
131131- (fall asleep, call on me)
132132- (oh babe, why don'cha)
133133- yeah, it's how you feel
134134- when the stars come out
135135- (you're never gonna get it)
136136- (while you've lost yourself in a rut)
137137- all in
138138- let me ride the wave
139139- (i'm so stressed)
140140- (i need to fly out of this place)
141141- yeah, 'cause we can drift
142142- 'til the break of dawn
143143- (i think i'll be okay)
144144- (if i can sleep today)
145145-146146- yeah... woo!
147147- (BASS)
148148- oh man...
149149- i'm just sitting here
150150- feeling the breeze
151151- hanging out
152152- listening to the crickets
153153- and the trees in the breeze
154154- living my best life`,
155155- },
156156- // {
157157- // Id: "free2play",
158158- // Title: "free2play",
159159- // Type: "upcoming",
160160- // ReleaseDate: make_date_work("17-Mar-2024"),
161161- // Buyname: "pre-order",
162162- // Buylink: "https://arimelody.me/",
163163- // Description: "hello from your local SPACEGIRL! 💫",
164164- // Credits: []AlbumCredit{
165165- // AlbumCredit{
166166- // Artist: &ari,
167167- // Role: "vocals",
168168- // },
169169- // AlbumCredit{
170170- // Artist: &ari,
171171- // Role: "production",
172172- // },
173173- // AlbumCredit{
174174- // Artist: &ari,
175175- // Role: "artwork",
176176- // },
177177- // },
178178- // },
179179- {
180180- Id: "dream",
181181- Title: "Dream",
182182- Type: "single",
183183- ReleaseDate: make_date_work("11-Nov-2022"),
184184- Artwork: "https://mellodoot.com/img/music_artwork/mellodoot_-_Dream.webp",
185185- Buylink: "https://arimelody.bandcamp.com/track/dream",
186186- Links: []MusicLink{
187187- {
188188- Name: "spotify",
189189- Url: "https://open.spotify.com/album/5talRpqzjExP1w6j5LFIAh",
190190- },
191191- {
192192- Name: "apple music",
193193- Url: "https://music.apple.com/ie/album/dream-single/1650037132",
194194- },
195195- {
196196- Name: "soundcloud",
197197- Url: "https://soundcloud.com/arimelody/dream2022",
198198- },
199199- {
200200- Name: "youtube",
201201- Url: "https://www.youtube.com/watch?v=nfFgtMuYAx8",
202202- },
203203- },
204204- Description: "living the dream 🌌 ✨",
205205- Credits: []MusicCredit{
206206- {
207207- Artist: &mellodoot,
208208- Role: "vocals",
209209- },
210210- {
211211- Artist: &mellodoot,
212212- Role: "production",
213213- },
214214- {
215215- Artist: &mellodoot,
216216- Role: "artwork",
217217- },
218218- },
219219- Lyrics:
220220- `the truth is what you make of it
221221- in the end, what you spend, is the end of it
222222- when you're lost in the life
223223- the life that you created on your own
224224- i'm becoming one
225225- with the soul that i see in the mirror
226226- blending one and whole
227227- this time, i'm real
228228-229229- i'm living the dream
230230- i'm living my best life
231231- running out of time
232232- i gotta make this right
233233- whenever you rise
234234- whenever you come down
235235- fall away from the light
236236- and then fall into our arms
237237-238238- the truth is what you make of it
239239- in the end, what you spend, is the end of it
240240- when you're lost in the life
241241- the life that you created on your own
242242- i'm becoming one
243243- with the soul that i see in the mirror
244244- blending one and whole
245245- this time, i'm real`,
246246- },
247247- {
248248- Id: "gomyway",
249249- Title: "Go My Way",
250250- Type: "single",
251251- ReleaseDate: make_date_work("24-Jan-2021"),
252252- Artwork: "https://mellodoot.com/img/music_artwork/mellodoot_-_Go_My_Way.webp",
253253- Buylink: "https://arimelody.bandcamp.com/track/go-my-way",
254254- Links: []MusicLink{
255255- {
256256- Name: "spotify",
257257- Url: "https://open.spotify.com/album/35WNtxK12IDHCUoXHDePGE",
258258- },
259259- {
260260- Name: "apple music",
261261- Url: "https://music.apple.com/ie/album/go-my-way-single/1547145699",
262262- },
263263- {
264264- Name: "soundcloud",
265265- Url: "https://soundcloud.com/arimelody/go-my-way",
266266- },
267267- {
268268- Name: "youtube",
269269- Url: "https://www.youtube.com/watch?v=CNptNQdLkl0",
270270- },
271271- },
272272- Description: "hey! go my way! 💥 ✨",
273273- Credits: []MusicCredit{
274274- {
275275- Artist: &mellodoot,
276276- Role: "vocals",
277277- },
278278- {
279279- Artist: &mellodoot,
280280- Role: "production",
281281- },
282282- {
283283- Artist: &mellodoot,
284284- Role: "artwork",
285285- },
286286- },
287287- },
288288- {
289289- Id: "rowboat",
290290- Title: "Rowboat",
291291- Type: "single",
292292- ReleaseDate: make_date_work("12-Mar-2020"),
293293- Artwork: "https://mellodoot.com/img/music_artwork/mellodoot_-_Rowboat.webp",
294294- Buylink: "https://arimelody.bandcamp.com/track/rowboat",
295295- Links: []MusicLink{
296296- {
297297- Name: "spotify",
298298- Url: "https://open.spotify.com/album/7jyqJFVKaENCPm58v5O44Y",
299299- },
300300- {
301301- Name: "apple music",
302302- Url: "https://music.apple.com/ie/album/rowboat-single/1502608714",
303303- },
304304- {
305305- Name: "soundcloud",
306306- Url: "https://soundcloud.com/arimelody/rowboat",
307307- },
308308- {
309309- Name: "youtube",
310310- Url: "https://www.youtube.com/watch?v=uOQyILDTzME",
311311- },
312312- },
313313- Description: "let's take a trip. i've got a goddamn boat ⛵️",
314314- Credits: []MusicCredit{
315315- {
316316- Artist: &mellodoot,
317317- Role: "vocals",
318318- },
319319- {
320320- Artist: &mellodoot,
321321- Role: "production",
322322- },
323323- {
324324- Artist: &mellodoot,
325325- Role: "artwork",
326326- },
327327- },
328328- },
329329- {
330330- Id: "helloworld",
331331- Title: "Hello World",
332332- Type: "single",
333333- ReleaseDate: make_date_work("25-Dec-2019"),
334334- Artwork: "https://mellodoot.com/img/music_artwork/mellodoot_-_Hello_World.webp",
335335- Buylink: "https://arimelody.bandcamp.com/track/hello-world",
336336- Links: []MusicLink{
337337- {
338338- Name: "spotify",
339339- Url: "https://open.spotify.com/album/3LbElPXD4dsDumttGBuYxx",
340340- },
341341- {
342342- Name: "apple music",
343343- Url: "https://music.apple.com/ie/album/hello-world-single/1491880155",
344344- },
345345- {
346346- Name: "soundcloud",
347347- Url: "https://soundcloud.com/arimelody/helloworld",
348348- },
349349- {
350350- Name: "youtube",
351351- Url: "https://www.youtube.com/watch?v=CQhlRsl0Mjk",
352352- },
353353- },
354354- Description: "we'll dawn a new frontier! 👾",
355355- Credits: []MusicCredit{
356356- {
357357- Artist: &mellodoot,
358358- Role: "vocals",
359359- },
360360- {
361361- Artist: &mellodoot,
362362- Role: "production",
363363- },
364364- {
365365- Artist: &mellodoot,
366366- Role: "artwork",
367367- },
368368- },
369369- },
370370- {
371371- Id: "sine",
372372- Title: "Sine",
373373- Type: "single",
374374- ReleaseDate: make_date_work("07-Dec-2019"),
375375- Artwork: "https://mellodoot.com/img/music_artwork/zaire_-_Sine_ft._mellodoot.webp",
376376- Links: []MusicLink{
377377- {
378378- Name: "spotify",
379379- Url: "https://open.spotify.com/album/4WPuaJtTV7z86KubD9Rnmk",
380380- },
381381- {
382382- Name: "apple music",
383383- Url: "https://music.apple.com/us/album/sine-feat-mellodoot/1489163020",
384384- },
385385- {
386386- Name: "youtube",
387387- Url: "https://www.youtube.com/watch?v=z1H1s6VRnyY",
388388- },
389389- },
390390- Credits: []MusicCredit{
391391- {
392392- Artist: &zaire,
393393- Role: "production",
394394- },
395395- {
396396- Artist: &mellodoot,
397397- Role: "production",
398398- },
399399- },
400400- },
401401- {
402402- Id: "10",
403403- Title: "10",
404404- Type: "single",
405405- ReleaseDate: make_date_work("29-Sep-2019"),
406406- Artwork: "https://mellodoot.com/img/music_artwork/mellodoot_-_10.webp",
407407- Buylink: "https://arimelody.bandcamp.com/track/10",
408408- Links: []MusicLink{
409409- {
410410- Name: "spotify",
411411- Url: "https://open.spotify.com/album/2x4gbACfDm99unaXpLXyj0",
412412- },
413413- {
414414- Name: "apple music",
415415- Url: "https://music.apple.com/ie/album/ten-single/1483193041",
416416- },
417417- {
418418- Name: "soundcloud",
419419- Url: "https://soundcloud.com/arimelody/ten",
420420- },
421421- {
422422- Name: "youtube",
423423- Url: "https://www.youtube.com/watch?v=C7WP5L2BK4U",
424424- },
425425- },
426426- Credits: []MusicCredit{
427427- {
428428- Artist: &mellodoot,
429429- Role: "production",
430430- },
431431- {
432432- Artist: &mellodoot,
433433- Role: "artwork",
434434- },
435435- },
436436- },
437437- {
438438- Id: "mad",
439439- Title: "MAD",
440440- Type: "single",
441441- ReleaseDate: make_date_work("03-Nov-2018"),
442442- Artwork: "https://mellodoot.com/img/music_artwork/mellodoot_-_MAD.webp",
443443- Buylink: "https://arimelody.bandcamp.com/track/mad",
444444- Links: []MusicLink{
445445- {
446446- Name: "spotify",
447447- Url: "https://open.spotify.com/album/59nFXw1WNoRhXou7lXqBZd",
448448- },
449449- {
450450- Name: "apple music",
451451- Url: "https://music.apple.com/ie/album/mad/1441233120",
452452- },
453453- {
454454- Name: "soundcloud",
455455- Url: "https://soundcloud.com/arimelody/mad",
456456- },
457457- {
458458- Name: "youtube",
459459- Url: "https://www.youtube.com/watch?v=OB-Pk6p6mfQ",
460460- },
461461- },
462462- Credits: []MusicCredit{
463463- {
464464- Artist: &mellodoot,
465465- Role: "vocals",
466466- },
467467- {
468468- Artist: &mellodoot,
469469- Role: "production",
470470- },
471471- {
472472- Artist: &mellodoot,
473473- Role: "artwork",
474474- },
475475- },
476476- },
477477- {
478478- Id: "welcomingparty",
479479- Title: "Welcoming Party",
480480- Type: "album",
481481- ReleaseDate: make_date_work("01-Nov-2018"),
482482- Artwork: "https://mellodoot.com/img/music_artwork/mellodoot_-_Welcoming_Party.webp",
483483- Buylink: "https://arimelody.bandcamp.com/album/welcoming-party",
484484- Links: []MusicLink{
485485- {
486486- Name: "spotify",
487487- Url: "https://open.spotify.com/album/3EPa4HZpkISQVRAks64LfR",
488488- },
489489- {
490490- Name: "apple music",
491491- Url: "https://music.apple.com/ie/album/welcoming-party-ep/1441161424",
492492- },
493493- {
494494- Name: "soundcloud",
495495- Url: "https://soundcloud.com/arimelody/sets/welcoming-party",
496496- },
497497- {
498498- Name: "youtube",
499499- Url: "https://www.youtube.com/playlist?list=PLBG_QJeOHrB5EeniiXBIlHpoQbD6CUJca",
500500- },
501501- },
502502- Credits: []MusicCredit{
503503- {
504504- Artist: &mellodoot,
505505- Role: "production",
506506- },
507507- {
508508- Artist: &mellodoot,
509509- Role: "artwork",
510510- },
511511- },
512512- // "tracks": [
513513- // {
514514- // "title": "Paradigm"
515515- // },
516516- // {
517517- // "title": "Mitrio"
518518- // },
519519- // {
520520- // "title": "Level One"
521521- // },
522522- // {
523523- // "title": "Cubes"
524524- // },
525525- // {
526526- // "title": "Aria"
527527- // }
528528- // ]
529529- },
530530- {
531531- Id: "howtheyknow2018",
532532- Title: "How They Know (2018)",
533533- Type: "single",
534534- ReleaseDate: make_date_work("27-Feb-2018"),
535535- Artwork: "https://mellodoot.com/img/music_artwork/mellodoot_-_How_They_Know_2018.webp",
536536- Buyname: "free download",
537537- Buylink: "https://arimelody.bandcamp.com/track/how-they-know-2018-remastered",
538538- Links: []MusicLink{
539539- {
540540- Name: "soundcloud",
541541- Url: "https://soundcloud.com/arimelody/how-they-know-2018",
542542- },
543543- {
544544- Name: "youtube",
545545- Url: "https://www.youtube.com/watch?v=mbAgSwCzyMw",
546546- },
547547- },
548548- Credits: []MusicCredit{
549549- {
550550- Artist: &mellodoot,
551551- Role: "production",
552552- },
553553- {
554554- Artist: &red,
555555- Role: "artwork",
556556- Meta: true,
557557- },
558558- },
559559- },
560560- {
561561- Id: "howtheyknow",
562562- Title: "How They Know",
563563- Type: "single",
564564- ReleaseDate: make_date_work("29-Nov-2017"),
565565- Artwork: "https://mellodoot.com/img/music_artwork/mellodoot_-_How_They_Know.webp",
566566- Buyname: "free download",
567567- Buylink: "https://arimelody.bandcamp.com/track/how-they-know",
568568- Links: []MusicLink{
569569- {
570570- Name: "soundcloud",
571571- Url: "https://soundcloud.com/arimelody/how-they-know",
572572- },
573573- {
574574- Name: "youtube",
575575- Url: "https://www.youtube.com/watch?v=q6lzKuG1Emo",
576576- },
577577- },
578578- Credits: []MusicCredit{
579579- {
580580- Artist: &mellodoot,
581581- Role: "production",
582582- },
583583- {
584584- Artist: &red,
585585- Role: "artwork",
586586- Meta: true,
587587- },
588588- },
589589- },
590590- {
591591- Id: "traveller",
592592- Title: "Traveller",
593593- Type: "single",
594594- ReleaseDate: make_date_work("24-Sep-2017"),
595595- Artwork: "https://mellodoot.com/img/music_artwork/mellodoot_-_Traveller.webp",
596596- Buyname: "free download",
597597- Buylink: "https://arimelody.bandcamp.com/track/traveller",
598598- Links: []MusicLink{
599599- {
600600- Name: "soundcloud",
601601- Url: "https://soundcloud.com/arimelody/traveller",
602602- },
603603- {
604604- Name: "youtube",
605605- Url: "https://www.youtube.com/watch?v=ZTO7IQZ-yXA",
606606- },
607607- },
608608- Description: "an 8-bit expedition! ⚔️🛡️",
609609- Credits: []MusicCredit{
610610- {
611611- Artist: &mellodoot,
612612- Role: "production",
613613- },
614614- {
615615- Artist: &mellodoot,
616616- Role: "artwork",
617617- },
618618- },
619619- },
62015}
6211662217func GetRelease(id string) (MusicRelease, bool) {
+161
api/v1/music/music_placeholders.go
···11+package music
22+33+var ari = Artist{
44+ Id: "arimelody",
55+ Name: "ari melody",
66+ Website: "https://arimelody.me",
77+}
88+var mellodoot = Artist{
99+ Id: "mellodoot",
1010+ Name: "mellodoot",
1111+ Website: "https://mellodoot.com",
1212+}
1313+var zaire = Artist{
1414+ Id: "zaire",
1515+ Name: "zaire",
1616+ Website: "https://supitszaire.com",
1717+}
1818+var mae = Artist{
1919+ Id: "maetaylor",
2020+ Name: "mae taylor",
2121+ Website: "https://mae.wtf",
2222+}
2323+var loudar = Artist{
2424+ Id: "loudar",
2525+ Name: "Loudar",
2626+ Website: "https://alex.targoninc.com",
2727+}
2828+var red = Artist {
2929+ Id: "smoljorb",
3030+ Name: "smoljorb",
3131+}
3232+3333+var placeholders = []MusicRelease{
3434+ {
3535+ Id: "test",
3636+ Title: "test album",
3737+ Type: "album",
3838+ ReleaseDate: make_date_work("18-Mar-2024"),
3939+ Buyname: "go get it!!",
4040+ Buylink: "https://arimelody.me/",
4141+ Links: []MusicLink{
4242+ {
4343+ Name: "youtube",
4444+ Url: "https://youtu.be/dQw4w9WgXcQ",
4545+ },
4646+ },
4747+ Description:
4848+ `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.`,
4949+ Credits: []MusicCredit{
5050+ {
5151+ Artist: &ari,
5252+ Role: "having the swag",
5353+ },
5454+ {
5555+ Artist: &zaire,
5656+ Role: "having the swag",
5757+ },
5858+ {
5959+ Artist: &mae,
6060+ Role: "having the swag",
6161+ },
6262+ {
6363+ Artist: &loudar,
6464+ Role: "having the swag",
6565+ },
6666+ },
6767+ Tracks: []MusicTrack{
6868+ {
6969+ Number: 0,
7070+ Title: "track 1",
7171+ Description: "sample track description",
7272+ Lyrics: "sample lyrics for track 1!",
7373+ PreviewUrl: "https://mellodoot.com/audio/preview/dream.webm",
7474+ },
7575+ {
7676+ Number: 1,
7777+ Title: "track 2",
7878+ Description: "sample track description",
7979+ Lyrics: "sample lyrics for track 2!",
8080+ PreviewUrl: "https://mellodoot.com/audio/preview/dream.webm",
8181+ },
8282+ },
8383+ },
8484+ {
8585+ Id: "dream",
8686+ Title: "Dream",
8787+ Type: "single",
8888+ ReleaseDate: make_date_work("11-Nov-2022"),
8989+ Artwork: "https://mellodoot.com/img/music_artwork/mellodoot_-_Dream.webp",
9090+ Buylink: "https://arimelody.bandcamp.com/track/dream",
9191+ Links: []MusicLink{
9292+ {
9393+ Name: "spotify",
9494+ Url: "https://open.spotify.com/album/5talRpqzjExP1w6j5LFIAh",
9595+ },
9696+ {
9797+ Name: "apple music",
9898+ Url: "https://music.apple.com/ie/album/dream-single/1650037132",
9999+ },
100100+ {
101101+ Name: "soundcloud",
102102+ Url: "https://soundcloud.com/arimelody/dream2022",
103103+ },
104104+ {
105105+ Name: "youtube",
106106+ Url: "https://www.youtube.com/watch?v=nfFgtMuYAx8",
107107+ },
108108+ },
109109+ Description: "living the dream 🌌 ✨",
110110+ Credits: []MusicCredit{
111111+ {
112112+ Artist: &mellodoot,
113113+ Role: "vocals",
114114+ },
115115+ {
116116+ Artist: &mellodoot,
117117+ Role: "production",
118118+ },
119119+ {
120120+ Artist: &mellodoot,
121121+ Role: "artwork",
122122+ },
123123+ },
124124+ Tracks: []MusicTrack{
125125+ {
126126+ Number: 0,
127127+ Title: "Dream",
128128+ Description: "no description here!",
129129+ Lyrics:
130130+ `the truth is what you make of it
131131+ in the end, what you spend, is the end of it
132132+ when you're lost in the life
133133+ the life that you created on your own
134134+ i'm becoming one
135135+ with the soul that i see in the mirror
136136+ blending one and whole
137137+ this time, i'm real
138138+139139+ i'm living the dream
140140+ i'm living my best life
141141+ running out of time
142142+ i gotta make this right
143143+ whenever you rise
144144+ whenever you come down
145145+ fall away from the light
146146+ and then fall into our arms
147147+148148+ the truth is what you make of it
149149+ in the end, what you spend, is the end of it
150150+ when you're lost in the life
151151+ the life that you created on your own
152152+ i'm becoming one
153153+ with the soul that i see in the mirror
154154+ blending one and whole
155155+ this time, i'm real`,
156156+ PreviewUrl: "https://mellodoot.com/audio/preview/dream.webm",
157157+ },
158158+ },
159159+ },
160160+}
161161+
+26-62
api/v1/music/music_types.go
···2424 Links []MusicLink
2525 Description string
2626 Credits []MusicCredit
2727- Lyrics string
2727+ Tracks []MusicTrack
2828 }
29293030 MusicLink struct {
···3737 Role string
3838 Meta bool // for "meta" contributors (i.e. not credited for the musical work, but other related assets)
3939 }
4040-)
41404242-func (album MusicRelease) GetUniqueArtists() []Artist {
4343- if len(album.Credits) == 1 {
4444- return []Artist{*album.Credits[0].Artist}
4141+ MusicTrack struct {
4242+ Number int
4343+ Title string
4444+ Description string
4545+ Lyrics string
4646+ PreviewUrl string
4547 }
4848+)
46494747- // create a map of artists to prevent duplicates
4848- res := []Artist{}
4949- for _, credit := range album.Credits {
5050- artist := *credit.Artist
5151- exists := false
5252- for _, c := range res {
5353- if c == *credit.Artist {
5454- exists = true
5555- break
5656- }
5757- }
5858- if exists {
5050+func (release MusicRelease) GetUniqueArtists(include_meta bool) []*Artist {
5151+ res := []*Artist{}
5252+ for _, credit := range release.Credits {
5353+ if !include_meta && credit.Meta {
5954 continue
6055 }
6161- res = append(res, artist)
6262- }
63566464- // now create the actual array to send
6565- return res
6666-}
6767-6868-func (album MusicRelease) GetUniqueNonMetaArtists() []Artist {
6969- if len(album.Credits) == 1 {
7070- return []Artist{*album.Credits[0].Artist}
7171- }
7272-7373- // create a map of artists to prevent duplicates
7474- res := []Artist{}
7575- for _, credit := range album.Credits {
7676- if credit.Meta {
7777- continue
7878- }
7979- artist := *credit.Artist
8057 exists := false
8181- for _, c := range res {
8282- if c == *credit.Artist {
5858+ for _, a := range res {
5959+ if a == credit.Artist {
8360 exists = true
8461 break
8562 }
···8764 if exists {
8865 continue
8966 }
9090- res = append(res, artist)
6767+6868+ res = append(res, credit.Artist)
9169 }
92709371 // now create the actual array to send
9472 return res
9573}
96749797-func (album MusicRelease) GetUniqueArtistNames() []string {
9898- if len(album.Credits) == 1 {
9999- return []string{album.Credits[0].Artist.Name}
100100- }
101101-102102- artists := album.GetUniqueArtists()
103103- names := []string{}
104104- for _, artist := range artists {
105105- names = append(names, artist.Name)
106106- }
107107-108108- return names
109109-}
110110-111111-func (album MusicRelease) GetUniqueNonMetaArtistNames() []string {
112112- if len(album.Credits) == 1 {
113113- return []string{album.Credits[0].Artist.Name}
114114- }
115115-116116- artists := album.GetUniqueNonMetaArtists()
7575+func (release MusicRelease) GetUniqueArtistNames(include_meta bool) []string {
7676+ artists := release.GetUniqueArtists(include_meta)
11777 names := []string{}
11878 for _, artist := range artists {
11979 names = append(names, artist.Name)
···12282 return names
12383}
12484125125-func (album MusicRelease) PrintPrimaryArtists() string {
126126- names := album.GetUniqueNonMetaArtistNames()
8585+func (album MusicRelease) PrintPrimaryArtists(include_meta bool) string {
8686+ names := album.GetUniqueArtistNames(include_meta)
12787 if len(names) == 1 {
12888 return names[0]
12989 }
···13292 return res
13393}
13494135135-func (album MusicRelease) PrintCommaPrimaryArtists() string {
136136- names := album.GetUniqueNonMetaArtistNames()
9595+func (album MusicRelease) PrintCommaPrimaryArtists(include_meta bool) string {
9696+ names := album.GetUniqueArtistNames(include_meta)
13797 if len(names) == 1 {
13898 return names[0]
13999 }
···165125func (link MusicLink) NormaliseName() string {
166126 re := regexp.MustCompile(`[^a-z0-9]`)
167127 return strings.ToLower(re.ReplaceAllString(link.Name, ""))
128128+}
129129+130130+func (release MusicRelease) IsSingle() bool {
131131+ return len(release.Tracks) == 1;
168132}
169133170134func (credit MusicCredit) ResolveArtist() Artist {
+25-12
db.go
···2525 release_date DATE NOT NULL,
2626 artwork TEXT,
2727 buyname TEXT,
2828- buylink TEXT,
2929- description TEXT,
3030- lyrics TEXT
2828+ buylink TEXT
3129);
32303331CREATE TABLE IF NOT EXISTS musiclinks (
3434- album VARCHAR(64) REFERENCES musicreleases(id) ON DELETE CASCADE ON UPDATE CASCADE,
3232+ release VARCHAR(64) REFERENCES musicreleases(id) ON DELETE CASCADE ON UPDATE CASCADE,
3533 name TEXT,
3634 url TEXT,
3737- CONSTRAINT musiclinks_pk PRIMARY KEY (album, name)
3535+ CONSTRAINT musiclinks_pk PRIMARY KEY (release, name)
3836);
39374038CREATE TABLE IF NOT EXISTS musiccredits (
4141- album VARCHAR(64) REFERENCES musicreleases(ID) ON DELETE CASCADE,
3939+ release VARCHAR(64) REFERENCES musicreleases(ID) ON DELETE CASCADE,
4240 artist TEXT REFERENCES artists(id) ON DELETE CASCADE,
4341 role TEXT,
4442 meta BOOLEAN,
4545- constraint musiccredits_pk PRIMARY KEY (album, artist, role)
4343+ constraint musiccredits_pk PRIMARY KEY (release, artist)
4444+);
4545+4646+CREATE TABLE IF NOT EXISTS musictracks (
4747+ release VARCHAR(64) REFERENCES musicreleases(ID) ON DELETE CASCADE,
4848+ number INT NOT NULL,
4949+ title TEXT NOT NULL,
5050+ description TEXT,
5151+ lyrics TEXT,
5252+ preview_url TEXT,
5353+ CONSTRAINT musictracks_pk PRIMARY KEY (release, number)
4654);`
47554856func PushArtist(db *sqlx.DB, artist music.Artist) {
···6169 fmt.Printf("syncing release [%s] to database...", release.Id)
62706371 tx := db.MustBegin()
6464- tx.MustExec("INSERT INTO musicreleases (id, title, release_date, artwork, buyname, buylink, description, lyrics) VALUES ($1, $2, $3, $4, $5, $6, $7, $8) "+
6565- "ON CONFLICT (id) DO UPDATE SET title=$2, release_date=$3, artwork=$4, buyname=$5, buylink=$6, description=$7, lyrics=$8",
6666- &release.Id, &release.Title, release.ReleaseDate.Format("2-Jan-2006"), &release.Artwork, &release.Buyname, &release.Buylink, &release.Description, &release.Lyrics)
7272+ tx.MustExec("INSERT INTO musicreleases (id, title, type, release_date, artwork, buyname, buylink) VALUES ($1, $2, $3, $4, $5, $6, $7) "+
7373+ "ON CONFLICT (id) DO UPDATE SET title=$2, type=$3, release_date=$4, artwork=$5, buyname=$6, buylink=$7",
7474+ &release.Id, &release.Title, &release.Type, release.ReleaseDate.Format("2-Jan-2006"), &release.Artwork, &release.Buyname, &release.Buylink)
67756876 for _, link := range release.Links {
6969- tx.MustExec("INSERT INTO musiclinks (album, name, url) VALUES ($1, $2, $3) ON CONFLICT (album, name) DO UPDATE SET url=$3",
7777+ tx.MustExec("INSERT INTO musiclinks (release, name, url) VALUES ($1, $2, $3) ON CONFLICT (release, name) DO UPDATE SET url=$3",
7078 &release.Id, &link.Name, &link.Url)
7179 }
7280 for _, credit := range release.Credits {
7373- tx.MustExec("INSERT INTO musiccredits (album, artist, role, meta) VALUES ($1, $2, $3, $4) ON CONFLICT DO NOTHING",
8181+ tx.MustExec("INSERT INTO musiccredits (release, artist, role, meta) VALUES ($1, $2, $3, $4) ON CONFLICT DO NOTHING",
7482 &release.Id, &credit.Artist.Id, &credit.Role, &credit.Meta)
8383+ }
8484+ for _, track := range release.Tracks {
8585+ tx.MustExec("INSERT INTO musictracks (release, number, title, description, lyrics, preview_url) VALUES ($1, $2, $3, $4, $5, $6) "+
8686+ "ON CONFLICT (release, number) DO UPDATE SET title=$3, description=$4, lyrics=$5, preview_url=$6",
8787+ &release.Id, &track.Number, &track.Title, &track.Description, &track.Lyrics, &track.PreviewUrl)
7588 }
76897790 tx.Commit()