22 lines
388 B
Go
22 lines
388 B
Go
package tracks
|
|
|
|
import (
|
|
"net/http"
|
|
|
|
"github.com/aerogo/aero"
|
|
"github.com/animenotifier/arn"
|
|
"github.com/animenotifier/notify.moe/components"
|
|
)
|
|
|
|
// Get track.
|
|
func Get(ctx *aero.Context) string {
|
|
id := ctx.Get("id")
|
|
track, err := arn.GetSoundTrack(id)
|
|
|
|
if err != nil {
|
|
return ctx.Error(http.StatusNotFound, "Track not found", err)
|
|
}
|
|
|
|
return ctx.HTML(components.Track(track))
|
|
}
|