22 lines
410 B
Go
Raw Normal View History

2016-11-23 03:44:28 +00:00
package airing
import (
"sort"
"github.com/aerogo/aero"
"github.com/animenotifier/arn"
"github.com/animenotifier/notify.moe/components"
)
// Get ...
func Get(ctx *aero.Context) string {
2016-11-23 05:26:59 +00:00
animeList, err := arn.GetAiringAnime()
2016-11-23 03:44:28 +00:00
2016-11-23 05:26:59 +00:00
if err != nil {
return ctx.Error(500, "Failed fetching airing anime", err)
2016-11-23 03:44:28 +00:00
}
sort.Sort(arn.AnimeByPopularity(animeList))
return ctx.HTML(components.Airing(animeList))
}