28 lines
587 B
Go
Raw Normal View History

2017-10-02 12:56:51 +00:00
package admin
2017-07-08 19:11:03 +00:00
import (
"net/http"
"sort"
"github.com/aerogo/aero"
"github.com/animenotifier/arn"
"github.com/animenotifier/notify.moe/components"
)
2017-10-02 12:56:51 +00:00
// AniList ...
func AniList(ctx *aero.Context) string {
2017-07-08 19:11:03 +00:00
missing, err := arn.FilterAnime(func(anime *arn.Anime) bool {
return anime.GetMapping("anilist/anime") == ""
})
if err != nil {
ctx.Error(http.StatusInternalServerError, "Couldn't filter anime", err)
}
sort.Slice(missing, func(i, j int) bool {
return missing[i].StartDate > missing[j].StartDate
})
return ctx.HTML(components.AniListMissingMapping(missing))
}