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