22 lines
439 B
Go
Raw Normal View History

2016-11-23 12:44:28 +09:00
package airing
import (
"github.com/aerogo/aero"
2017-06-06 22:08:43 +02:00
"github.com/animenotifier/arn"
"github.com/animenotifier/notify.moe/components"
2016-11-23 12:44:28 +09:00
)
// Get ...
func Get(ctx *aero.Context) string {
2017-06-06 22:08:43 +02:00
var cache arn.ListOfIDs
2017-06-10 02:19:31 +02:00
err := arn.DB.GetObject("Cache", "airing anime", &cache)
2016-11-23 18:07:02 +09:00
2017-06-06 22:08:43 +02:00
airing, err := arn.GetAiringAnimeCached()
2016-11-23 18:07:02 +09:00
2017-06-06 22:08:43 +02:00
if err != nil {
return ctx.Error(500, "Couldn't fetch airing anime", err)
}
return ctx.HTML(components.Airing(airing))
2016-11-23 12:44:28 +09:00
}