51 lines
936 B
Go
Raw Normal View History

2017-06-27 10:39:41 +00:00
package music
2017-06-27 12:01:32 +00:00
import (
"sort"
"github.com/aerogo/aero"
"github.com/animenotifier/arn"
"github.com/animenotifier/notify.moe/components"
)
2017-06-27 10:39:41 +00:00
// Get renders the music page.
func Get(ctx *aero.Context) string {
2017-06-27 11:46:29 +00:00
tracks := []*arn.SoundTrack{}
tracks = append(tracks, &arn.SoundTrack{
ID: "1",
Media: []arn.ExternalMedia{
arn.ExternalMedia{
Service: "Soundcloud",
ServiceID: "127672476",
},
},
Tags: []string{
"anime:7622",
},
2017-06-27 12:01:32 +00:00
Created: arn.DateTimeUTC(),
CreatedBy: "4J6qpK1ve",
2017-06-27 11:46:29 +00:00
})
tracks = append(tracks, &arn.SoundTrack{
ID: "2",
Media: []arn.ExternalMedia{
arn.ExternalMedia{
Service: "Soundcloud",
ServiceID: "270777538",
},
},
Tags: []string{
"anime:11469",
},
2017-06-27 12:01:32 +00:00
Created: arn.DateTimeUTC(),
CreatedBy: "4J6qpK1ve",
})
sort.Slice(tracks, func(i, j int) bool {
return tracks[i].Created > tracks[j].Created
2017-06-27 11:46:29 +00:00
})
return ctx.HTML(components.Music(tracks))
2017-06-27 10:39:41 +00:00
}