2017-06-20 22:54:45 +02:00
|
|
|
package popularanime
|
|
|
|
|
|
|
|
import (
|
2017-06-24 00:36:07 +02:00
|
|
|
"net/http"
|
|
|
|
|
2017-06-20 22:54:45 +02:00
|
|
|
"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
|
|
|
)
|
|
|
|
|
|
|
|
// Get search page.
|
|
|
|
func Get(ctx *aero.Context) string {
|
2017-06-23 19:12:05 -03:00
|
|
|
animeList, err := arn.GetPopularAnimeCached()
|
|
|
|
|
|
|
|
if err != nil {
|
2017-06-24 00:36:07 +02:00
|
|
|
return ctx.Error(http.StatusInternalServerError, "Error fetching popular anime", err)
|
2017-06-23 19:12:05 -03:00
|
|
|
}
|
|
|
|
|
2017-06-25 17:25:20 +02:00
|
|
|
return ctx.HTML(components.PopularAnime(animeList))
|
2017-06-20 22:54:45 +02:00
|
|
|
}
|