2024-08-02 21:48:26 +00:00
|
|
|
package model
|
|
|
|
|
2024-09-01 03:43:32 +00:00
|
|
|
import (
|
|
|
|
"html/template"
|
|
|
|
"strings"
|
|
|
|
)
|
|
|
|
|
|
|
|
type (
|
|
|
|
Track struct {
|
2024-09-03 07:07:45 +00:00
|
|
|
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"`
|
2024-09-01 03:43:32 +00:00
|
|
|
}
|
|
|
|
)
|
|
|
|
|
2024-09-03 07:07:45 +00:00
|
|
|
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
|
2024-08-02 21:48:26 +00:00
|
|
|
}
|