HOLY REFACTOR GOOD GRIEF (also finally started some CRUD work)

Signed-off-by: ari melody <ari@arimelody.me>
This commit is contained in:
ari melody 2024-08-02 22:48:26 +01:00
parent 1c310c9101
commit 442889340c
80 changed files with 1571 additions and 1330 deletions

16
music/model/link.go Normal file
View file

@ -0,0 +1,16 @@
package model
import (
"regexp"
"strings"
)
type Link struct {
Name string `json:"name"`
URL string `json:"url"`
}
func (link Link) NormaliseName() string {
rgx := regexp.MustCompile(`[^a-z0-9]`)
return strings.ToLower(rgx.ReplaceAllString(link.Name, ""))
}