25 lines
517 B
Go
Raw Normal View History

2017-10-02 04:29:58 +00:00
package soundtrack
2017-06-27 22:16:45 +00:00
import (
"net/http"
"github.com/aerogo/aero"
"github.com/animenotifier/arn"
"github.com/animenotifier/notify.moe/components"
2017-11-05 18:54:58 +00:00
"github.com/animenotifier/notify.moe/utils"
2017-06-27 22:16:45 +00:00
)
2017-07-13 06:23:20 +00:00
// Get track.
2017-06-27 22:16:45 +00:00
func Get(ctx *aero.Context) string {
id := ctx.Get("id")
track, err := arn.GetSoundTrack(id)
2017-11-05 18:54:58 +00:00
user := utils.GetUser(ctx)
2017-06-27 22:16:45 +00:00
if err != nil {
return ctx.Error(http.StatusNotFound, "Track not found", err)
}
2018-04-13 10:20:13 +00:00
ctx.Data = getOpenGraph(ctx, track)
2018-10-29 02:56:45 +00:00
return ctx.HTML(components.SoundTrackPage(track, user))
2018-04-13 10:20:13 +00:00
}