From 811fbdddbc97b61348365f68243d3e2c8fb69335 Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Thu, 26 Apr 2018 03:35:08 +0200 Subject: [PATCH] Simplified mal sync --- jobs/mal-sync/mal-sync.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/jobs/mal-sync/mal-sync.go b/jobs/mal-sync/mal-sync.go index 8f97d9ca..d43974e6 100644 --- a/jobs/mal-sync/mal-sync.go +++ b/jobs/mal-sync/mal-sync.go @@ -106,6 +106,14 @@ func sync(anime *arn.Anime, malID string) { } } + // Characters + syncCharacters(anime, malAnime) + + // Save in database + anime.Save() +} + +func syncCharacters(anime *arn.Anime, malAnime *mal.Anime) { // Check for existence of characters animeCharacters := anime.Characters() modifiedCharacters := false @@ -182,8 +190,6 @@ func sync(anime *arn.Anime, malID string) { if modifiedCharacters { animeCharacters.Save() } - - anime.Save() } func importCharacter(malCharacter *mal.Character) *arn.Character {