This commit is contained in:
2017-10-09 15:47:40 +02:00
parent be3dede5a9
commit 6e4897f435
21 changed files with 236 additions and 75 deletions

View File

@ -10,9 +10,11 @@ import (
const maxTracks = 9
// Get renders the music page.
// Get renders the soundtracks page.
func Get(ctx *aero.Context) string {
tracks, err := arn.AllSoundTracks()
tracks, err := arn.FilterSoundTracks(func(track *arn.SoundTrack) bool {
return !track.IsDraft
})
if err != nil {
return ctx.Error(http.StatusInternalServerError, "Error fetching soundtracks", err)
@ -24,5 +26,5 @@ func Get(ctx *aero.Context) string {
tracks = tracks[:maxTracks]
}
return ctx.HTML(components.Music(tracks))
return ctx.HTML(components.SoundTracks(tracks))
}