Updated MAL character sync

This commit is contained in:
Eduard Urbach 2018-11-13 18:51:51 +09:00
parent 94c2f59de2
commit 57e6e83ecd

View File

@ -100,12 +100,18 @@ func syncCharacter(character *arn.Character, malID string) {
character.Name.Japanese = malCharacter.JapaneseName
}
// Unless it's a manually created or edited character,
// update the description.
if character.CreatedBy == "" && character.EditedBy == "" {
description, attributes := parseCharacterDescription(malCharacter.Description)
if character.Name.Canonical == "" && malCharacter.Name != "" {
character.Name.Canonical = malCharacter.Name
}
allowUpdating := character.CreatedBy == "" && character.EditedBy == ""
description, attributes := parseCharacterDescription(malCharacter.Description)
if (allowUpdating || character.Description == "") && description != "" {
character.Description = description
}
if allowUpdating {
character.Attributes = attributes
character.Spoilers = []arn.Spoiler{}