this is immensely broken but i swear i'll fix it later
This commit is contained in:
parent
e2ec731109
commit
d5f1fcb5e0
28 changed files with 409 additions and 253 deletions
29
model/track.go
Normal file
29
model/track.go
Normal file
|
@ -0,0 +1,29 @@
|
|||
package model
|
||||
|
||||
import (
|
||||
"html/template"
|
||||
"strings"
|
||||
)
|
||||
|
||||
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"`
|
||||
}
|
||||
)
|
||||
|
||||
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
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue