Improved sync-anime
This commit is contained in:
parent
405ddf8003
commit
e19668775b
@ -12,11 +12,12 @@ import (
|
|||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
color.Yellow("Syncing Anime")
|
color.Yellow("Syncing Anime")
|
||||||
|
|
||||||
defer arn.Node.Close()
|
defer arn.Node.Close()
|
||||||
|
defer color.Green("Finished.")
|
||||||
|
|
||||||
// In case we refresh only one anime
|
// In case we refresh only one anime
|
||||||
if InvokeShellArgs() {
|
if InvokeShellArgs() {
|
||||||
color.Green("Finished.")
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -27,8 +28,6 @@ func main() {
|
|||||||
for anime := range allAnime {
|
for anime := range allAnime {
|
||||||
sync(anime)
|
sync(anime)
|
||||||
}
|
}
|
||||||
|
|
||||||
color.Green("Finished.")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func sync(data *kitsu.Anime) *arn.Anime {
|
func sync(data *kitsu.Anime) *arn.Anime {
|
||||||
@ -60,7 +59,8 @@ func sync(data *kitsu.Anime) *arn.Anime {
|
|||||||
anime.EpisodeLength = attr.EpisodeLength
|
anime.EpisodeLength = attr.EpisodeLength
|
||||||
anime.Status = attr.Status
|
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"
|
anime.Status = "upcoming"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user