Check for null disambiguation on validate (#5019)

This commit is contained in:
dogwithakeyboard 2024-06-27 01:12:39 +01:00 committed by GitHub
parent af6841be49
commit b7f938531b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 11 deletions

View File

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

View File

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