my god...it's finally done

This commit is contained in:
ari melody 2024-09-03 08:07:45 +01:00
parent 2baf71214e
commit 19d76ebc47
Signed by: ari
GPG key ID: CF99829C92678188
43 changed files with 1008 additions and 550 deletions

View file

@ -7,24 +7,23 @@ import (
type (
Track struct {
ID string `json:"id"`
Title string `json:"title"`
Description string `json:"description"`
Lyrics string `json:"lyrics" db:"lyrics"`
PreviewURL string `json:"previewURL" db:"preview_url"`
}
DisplayTrack struct {
*Track
Lyrics template.HTML `json:"lyrics"`
Number int `json:"-"`
ID string `json:"id"`
Title string `json:"title"`
Description string `json:"description"`
Lyrics string `json:"lyrics" db:"lyrics"`
PreviewURL string `json:"previewURL" db:"preview_url"`
}
)
func (track Track) MakeDisplay(number int) DisplayTrack {
return DisplayTrack{
Track: &track,
Lyrics: template.HTML(strings.Replace(track.Lyrics, "\n", "<br>", -1)),
Number: number,
}
func (track Track) GetDescriptionHTML() template.HTML {
return template.HTML(strings.Replace(track.Description, "\n", "<br>", -1))
}
func (track Track) GetLyricsHTML() template.HTML {
return template.HTML(strings.Replace(track.Lyrics, "\n", "<br>", -1))
}
// this function is stupid and i hate that i need it
func (track Track) Add(a int, b int) int {
return a + b
}