From 9057749cf9ca05a644d1e335ffc8da7acc995797 Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Sat, 7 Nov 2020 06:09:14 +0900 Subject: [PATCH] Cap the number of episodes --- arn/Anime.go | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/arn/Anime.go b/arn/Anime.go index 00d61ece..77bfd999 100644 --- a/arn/Anime.go +++ b/arn/Anime.go @@ -381,14 +381,10 @@ func (anime *Anime) RefreshEpisodes() error { episodes = episodes.Merge(shoboiEpisodes) - // // AnimeTwist - // twistEpisodes, err := anime.TwistEpisodes() - - // if err != nil { - // return err - // } - - // episodes = episodes.Merge(twistEpisodes) + // Cap the number of episodes + if anime.Status == "finished" && anime.EpisodeCount > 0 && len(episodes) > anime.EpisodeCount { + episodes = episodes[:anime.EpisodeCount] + } // Count number of available episodes newAvailableCount := episodes.AvailableCount()