Simplified mal sync

This commit is contained in:
Eduard Urbach 2018-04-26 03:35:08 +02:00
parent fc3254dad1
commit 811fbdddbc

View File

@ -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 {