Improved exploration

This commit is contained in:
2017-07-01 02:14:14 +02:00
parent 10ef00a810
commit 750302b60e
11 changed files with 114 additions and 67 deletions

View File

@ -1,20 +1,21 @@
package explore
import (
"net/http"
"github.com/aerogo/aero"
"github.com/animenotifier/arn"
"github.com/animenotifier/notify.moe/components"
)
// Get search page.
// Get ...
func Get(ctx *aero.Context) string {
animeList, err := arn.GetPopularAnimeCached()
var cache arn.ListOfIDs
err := arn.DB.GetObject("Cache", "airing anime", &cache)
airing, err := arn.GetAiringAnimeCached()
if err != nil {
return ctx.Error(http.StatusInternalServerError, "Error fetching popular anime", err)
return ctx.Error(500, "Couldn't fetch airing anime", err)
}
return ctx.HTML(components.ExploreAnime(nil, nil, animeList))
return ctx.HTML(components.Airing(airing))
}