diff --git a/patches/show-season/show-season.go b/patches/show-season/show-season.go index 0f079c68..db4891be 100644 --- a/patches/show-season/show-season.go +++ b/patches/show-season/show-season.go @@ -2,16 +2,27 @@ package main import ( "fmt" + "sort" "github.com/animenotifier/arn" ) func main() { + list := []*arn.Anime{} + for anime := range arn.StreamAnime() { - if anime.NSFW == 1 || anime.Status != "current" || anime.StartDate == "" || anime.StartDate < "2017-09" || anime.StartDate > "2017-10-17" { + if anime.NSFW == 1 || anime.Status != "current" || anime.Type != "tv" || anime.StartDate == "" || anime.StartDate < "2017-12" || anime.StartDate > "2018-02-01" { continue } + list = append(list, anime) + } + + sort.Slice(list, func(i, j int) bool { + return list[i].Popularity.Total() > list[j].Popularity.Total() + }) + + for _, anime := range list { fmt.Printf("* [%s](/anime/%s)\n", anime.Title.Canonical, anime.ID) } }