From e19668775b82ac9c19d631ecf425bc569b5df158 Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Sat, 11 Nov 2017 12:45:17 +0100 Subject: [PATCH] Improved sync-anime --- jobs/sync-anime/sync-anime.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/jobs/sync-anime/sync-anime.go b/jobs/sync-anime/sync-anime.go index d3bc38d6..048b83cb 100644 --- a/jobs/sync-anime/sync-anime.go +++ b/jobs/sync-anime/sync-anime.go @@ -12,11 +12,12 @@ import ( func main() { color.Yellow("Syncing Anime") + defer arn.Node.Close() + defer color.Green("Finished.") // In case we refresh only one anime if InvokeShellArgs() { - color.Green("Finished.") return } @@ -27,8 +28,6 @@ func main() { for anime := range allAnime { sync(anime) } - - color.Green("Finished.") } func sync(data *kitsu.Anime) *arn.Anime { @@ -60,7 +59,8 @@ func sync(data *kitsu.Anime) *arn.Anime { anime.EpisodeLength = attr.EpisodeLength anime.Status = attr.Status - if anime.Status == "tba" || anime.Status == "unreleased" { + // Status "unreleased" means the same as "upcoming" so we should normalize it + if anime.Status == "unreleased" { anime.Status = "upcoming" }