diff --git a/pkg/performer/validate.go b/pkg/performer/validate.go index 0106490cf..68f7a8ef5 100644 --- a/pkg/performer/validate.go +++ b/pkg/performer/validate.go @@ -102,11 +102,15 @@ func validateName(ctx context.Context, name string, disambig string, existingID }, } + modifier := models.CriterionModifierIsNull + if disambig != "" { - performerFilter.Disambiguation = &models.StringCriterionInput{ - Value: disambig, - Modifier: models.CriterionModifierEquals, - } + modifier = models.CriterionModifierEquals + } + + performerFilter.Disambiguation = &models.StringCriterionInput{ + Value: disambig, + Modifier: modifier, } if existingID == nil { diff --git a/pkg/performer/validate_test.go b/pkg/performer/validate_test.go index 778459f17..33f4b1cec 100644 --- a/pkg/performer/validate_test.go +++ b/pkg/performer/validate_test.go @@ -15,6 +15,9 @@ func nameFilter(n string) *models.PerformerFilterType { Value: n, Modifier: models.CriterionModifierEquals, }, + Disambiguation: &models.StringCriterionInput{ + Modifier: models.CriterionModifierIsNull, + }, } } @@ -41,13 +44,6 @@ func TestValidateName(t *testing.T) { newName = "new name" newDisambig = "new disambiguation" ) - // existing1 := models.Performer{ - // Name: name1, - // } - // existing2 := models.Performer{ - // Name: name2, - // Disambiguation: disambig, - // } pp := 1 findFilter := &models.FindFilterType{