package anime import ( "net/http" "github.com/animenotifier/notify.moe/components" "github.com/aerogo/aero" "github.com/animenotifier/notify.moe/arn" ) // Tracks ... func Tracks(ctx aero.Context) error { id := ctx.Get("id") user := arn.GetUserFromContext(ctx) anime, err := arn.GetAnime(id) if err != nil { return ctx.Error(http.StatusNotFound, "Anime not found", err) } tracks := arn.FilterSoundTracks(func(track *arn.SoundTrack) bool { return !track.IsDraft && len(track.Media) > 0 && arn.Contains(track.Tags, "anime:"+anime.ID) }) return ctx.HTML(components.AnimeTracks(anime, tracks, user, true)) }