2017-07-01 01:16:25 +02:00
|
|
|
package explore
|
2017-06-20 22:54:45 +02:00
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/aerogo/aero"
|
2017-06-23 19:12:05 -03:00
|
|
|
"github.com/animenotifier/arn"
|
|
|
|
"github.com/animenotifier/notify.moe/components"
|
2017-06-20 22:54:45 +02:00
|
|
|
)
|
|
|
|
|
2017-07-01 02:14:14 +02:00
|
|
|
// Get ...
|
2017-06-20 22:54:45 +02:00
|
|
|
func Get(ctx *aero.Context) string {
|
2017-07-01 02:14:14 +02:00
|
|
|
var cache arn.ListOfIDs
|
|
|
|
err := arn.DB.GetObject("Cache", "airing anime", &cache)
|
|
|
|
|
|
|
|
airing, err := arn.GetAiringAnimeCached()
|
2017-06-23 19:12:05 -03:00
|
|
|
|
|
|
|
if err != nil {
|
2017-07-01 02:14:14 +02:00
|
|
|
return ctx.Error(500, "Couldn't fetch airing anime", err)
|
2017-06-23 19:12:05 -03:00
|
|
|
}
|
|
|
|
|
2017-07-01 02:14:14 +02:00
|
|
|
return ctx.HTML(components.Airing(airing))
|
2017-06-20 22:54:45 +02:00
|
|
|
}
|