2016-11-20 04:53:33 +09:00

28 lines
484 B
Go

package genres
import (
"fmt"
"github.com/aerogo/aero"
"github.com/animenotifier/arn"
"github.com/animenotifier/notify.moe/components"
)
// Get ...
func Get(ctx *aero.Context) string {
var genres []*arn.Genre
for _, genreName := range arn.Genres {
genre, err := arn.GetGenre(arn.GetGenreIDByName(genreName))
if err == nil {
genre.Name = genreName
genres = append(genres, genre)
} else {
fmt.Println(err)
}
}
return ctx.HTML(components.Genres(genres))
}