From e7426a3e7fa87dfe6d9424e506725896358bd771 Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Thu, 8 Mar 2018 00:12:22 +0100 Subject: [PATCH] Improved season link tool --- patches/show-season/show-season.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) 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) } }