From 0a807185f6b9e3de8a126ebaf5a631dff72cdd04 Mon Sep 17 00:00:00 2001 From: nallown Date: Sat, 11 Nov 2017 03:58:14 +0000 Subject: [PATCH 1/2] simple fix #152651119 - change anime status from "TBA" and "Unreleased" into "Upcoming" when imported from Kitsu --- jobs/sync-anime/sync-anime.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/jobs/sync-anime/sync-anime.go b/jobs/sync-anime/sync-anime.go index 9a412cb5..cdc57160 100644 --- a/jobs/sync-anime/sync-anime.go +++ b/jobs/sync-anime/sync-anime.go @@ -58,7 +58,13 @@ func sync(data *kitsu.Anime) *arn.Anime { anime.EndDate = attr.EndDate anime.EpisodeCount = attr.EpisodeCount anime.EpisodeLength = attr.EpisodeLength - anime.Status = attr.Status + + if strings.EqualFold(attr.Status, "tba") || strings.EqualFold(attr.Status, "unreleased") { + anime.Status = "Upcoming" + } else { + anime.Status = attr.Status + } + anime.Summary = arn.FixAnimeDescription(attr.Synopsis) if anime.Mappings == nil { From f6a6d17a833617aa030c1d6543878bede28081f2 Mon Sep 17 00:00:00 2001 From: nallown Date: Sat, 11 Nov 2017 09:33:28 +0000 Subject: [PATCH 2/2] Change "upcoming" to all lowercase and move default clause before the if --- jobs/sync-anime/sync-anime.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/jobs/sync-anime/sync-anime.go b/jobs/sync-anime/sync-anime.go index cdc57160..58ae3df3 100644 --- a/jobs/sync-anime/sync-anime.go +++ b/jobs/sync-anime/sync-anime.go @@ -58,11 +58,10 @@ func sync(data *kitsu.Anime) *arn.Anime { anime.EndDate = attr.EndDate anime.EpisodeCount = attr.EpisodeCount anime.EpisodeLength = attr.EpisodeLength + anime.Status = attr.Status - if strings.EqualFold(attr.Status, "tba") || strings.EqualFold(attr.Status, "unreleased") { - anime.Status = "Upcoming" - } else { - anime.Status = attr.Status + if attr.Status == "tba" || attr.Status == "unreleased" { + anime.Status = "upcoming" } anime.Summary = arn.FixAnimeDescription(attr.Synopsis)