arimelody.me/api/v1/music/music.go

34 lines
760 B
Go
Raw Normal View History

package music
import (
"fmt"
"time"
)
func make_date_work(date string) time.Time {
res, err := time.Parse("2-Jan-2006", date)
if err != nil {
fmt.Printf("somehow we failed to parse %s! falling back to epoch :]\n", date)
return time.Unix(0, 0)
}
return res
}
func GetRelease(id string) (MusicRelease, bool) {
for _, album := range placeholders {
if album.Id == id {
return album, true
}
}
return MusicRelease{}, false
}
func QueryAllMusic() ([]MusicRelease) {
return placeholders
}
func QueryAllArtists() ([]Artist) {
return []Artist{ ari, mellodoot, zaire, mae, loudar, red }
}