From 23b60323933be4d34b2b0b054b397c5bcb3c5c8e Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Mon, 11 Nov 2019 09:12:37 +0900 Subject: [PATCH] Updated RefreshEpisodes --- arn/Anime.go | 50 +++++++++++++++++++++++++------------------------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/arn/Anime.go b/arn/Anime.go index b165815a..8df120c5 100644 --- a/arn/Anime.go +++ b/arn/Anime.go @@ -427,7 +427,7 @@ func (anime *Anime) RefreshEpisodes() error { episodes := anime.Episodes() // Save number of available episodes for comparison later - oldAvailableCount := episodes.AvailableCount() + // oldAvailableCount := episodes.AvailableCount() // Shoboi shoboiEpisodes, err := anime.ShoboiEpisodes() @@ -439,36 +439,36 @@ func (anime *Anime) RefreshEpisodes() error { episodes = episodes.Merge(shoboiEpisodes) // AnimeTwist - twistEpisodes, err := anime.TwistEpisodes() + // twistEpisodes, err := anime.TwistEpisodes() - if err != nil { - return err - } + // if err != nil { + // return err + // } - episodes = episodes.Merge(twistEpisodes) + // episodes = episodes.Merge(twistEpisodes) // Count number of available episodes - newAvailableCount := episodes.AvailableCount() + // newAvailableCount := episodes.AvailableCount() - if anime.Status != "finished" && newAvailableCount > oldAvailableCount { - // New episodes have been released. - // Notify all users who are watching the anime. - go func() { - for _, user := range anime.UsersWatchingOrPlanned() { - if !user.Settings().Notification.AnimeEpisodeReleases { - continue - } + // if anime.Status != "finished" && newAvailableCount > oldAvailableCount { + // // New episodes have been released. + // // Notify all users who are watching the anime. + // go func() { + // for _, user := range anime.UsersWatchingOrPlanned() { + // if !user.Settings().Notification.AnimeEpisodeReleases { + // continue + // } - user.SendNotification(&PushNotification{ - Title: anime.Title.ByUser(user), - Message: "Episode " + strconv.Itoa(newAvailableCount) + " has been released!", - Icon: anime.ImageLink("medium"), - Link: "https://notify.moe" + anime.Link(), - Type: NotificationTypeAnimeEpisode, - }) - } - }() - } + // user.SendNotification(&PushNotification{ + // Title: anime.Title.ByUser(user), + // Message: "Episode " + strconv.Itoa(newAvailableCount) + " has been released!", + // Icon: anime.ImageLink("medium"), + // Link: "https://notify.moe" + anime.Link(), + // Type: NotificationTypeAnimeEpisode, + // }) + // } + // }() + // } // Number remaining episodes startNumber := 0