Updated sync tool

This commit is contained in:
Eduard Urbach 2018-03-09 05:36:43 +01:00
parent 65851b9128
commit 487df034d4

View File

@ -30,9 +30,14 @@ func main() {
}
}
func sync(data *kitsu.Anime) *arn.Anime {
func sync(data *kitsu.Anime) {
anime, err := arn.GetAnime(data.ID)
// This stops overwriting existing data
if err == nil || anime != nil {
return
}
if err != nil {
if strings.Contains(err.Error(), "not found") {
anime = &arn.Anime{
@ -150,6 +155,4 @@ func sync(data *kitsu.Anime) *arn.Anime {
// Log
fmt.Println(color.GreenString("✔"), anime.ID, anime.Title.Canonical)
return anime
}