Cap the number of episodes

This commit is contained in:
Eduard Urbach 2020-11-07 06:09:14 +09:00
parent 2b9ea49c9b
commit 9057749cf9
Signed by: akyoto
GPG Key ID: C874F672B1AF20C0

View File

@ -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()