diff --git a/frontend/src/graphql/queries/Draft.gql b/frontend/src/graphql/queries/Draft.gql index 357d8c1b4..6da1740f3 100644 --- a/frontend/src/graphql/queries/Draft.gql +++ b/frontend/src/graphql/queries/Draft.gql @@ -12,6 +12,7 @@ query Draft($id: ID!) { ... on PerformerDraft { id name + disambiguation aliases gender birthdate diff --git a/frontend/src/graphql/types.ts b/frontend/src/graphql/types.ts index 1172b9bf4..2a82fceca 100644 --- a/frontend/src/graphql/types.ts +++ b/frontend/src/graphql/types.ts @@ -809,6 +809,7 @@ export type PerformerDraft = { career_end_year?: Maybe; career_start_year?: Maybe; country?: Maybe; + disambiguation?: Maybe; ethnicity?: Maybe; eye_color?: Maybe; gender?: Maybe; @@ -830,6 +831,7 @@ export type PerformerDraftInput = { career_end_year?: InputMaybe; career_start_year?: InputMaybe; country?: InputMaybe; + disambiguation?: InputMaybe; ethnicity?: InputMaybe; eye_color?: InputMaybe; gender?: InputMaybe; @@ -13896,6 +13898,7 @@ export type DraftQuery = { __typename: "PerformerDraft"; id?: string | null; name: string; + disambiguation?: string | null; aliases?: string | null; gender?: string | null; birthdate?: string | null; @@ -39225,6 +39228,10 @@ export const DraftDocument = { kind: "Field", name: { kind: "Name", value: "name" }, }, + { + kind: "Field", + name: { kind: "Name", value: "disambiguation" }, + }, { kind: "Field", name: { kind: "Name", value: "aliases" }, diff --git a/frontend/src/pages/drafts/parse.ts b/frontend/src/pages/drafts/parse.ts index 9bf158ea4..aefb8e50d 100644 --- a/frontend/src/pages/drafts/parse.ts +++ b/frontend/src/pages/drafts/parse.ts @@ -167,7 +167,7 @@ export const parsePerformerDraft = ( const performer: InitialPerformer = { name: draft.name, - disambiguation: null, + disambiguation: draft.disambiguation ?? null, images: joinImages(draft.image, existingPerformer?.images), gender: parseEnum(draft.gender, GenderEnum) as GenderEnum | null, ethnicity: parseEnum( diff --git a/graphql/schema/types/performer.graphql b/graphql/schema/types/performer.graphql index 6f8d0121b..851dfb8be 100644 --- a/graphql/schema/types/performer.graphql +++ b/graphql/schema/types/performer.graphql @@ -368,6 +368,7 @@ input PerformerQueryInput { type PerformerDraft { id: ID name: String! + disambiguation: String aliases: String gender: String birthdate: String @@ -388,6 +389,7 @@ type PerformerDraft { input PerformerDraftInput { id: ID + disambiguation: String name: String! aliases: String gender: String diff --git a/pkg/api/resolver_mutation_draft.go b/pkg/api/resolver_mutation_draft.go index 0cf803b62..0a88676b8 100644 --- a/pkg/api/resolver_mutation_draft.go +++ b/pkg/api/resolver_mutation_draft.go @@ -84,6 +84,7 @@ func (r *mutationResolver) SubmitPerformerDraft(ctx context.Context, input model data := models.PerformerDraft{ ID: input.ID, Name: input.Name, + Disambiguation: input.Disambiguation, Aliases: input.Aliases, Gender: input.Gender, Birthdate: input.Birthdate, diff --git a/pkg/models/generated_exec.go b/pkg/models/generated_exec.go index 5d6162dd3..3cb418cf4 100644 --- a/pkg/models/generated_exec.go +++ b/pkg/models/generated_exec.go @@ -266,6 +266,7 @@ type ComplexityRoot struct { CareerEndYear func(childComplexity int) int CareerStartYear func(childComplexity int) int Country func(childComplexity int) int + Disambiguation func(childComplexity int) int Ethnicity func(childComplexity int) int EyeColor func(childComplexity int) int Gender func(childComplexity int) int @@ -2190,6 +2191,13 @@ func (e *executableSchema) Complexity(typeName, field string, childComplexity in return e.complexity.PerformerDraft.Country(childComplexity), true + case "PerformerDraft.disambiguation": + if e.complexity.PerformerDraft.Disambiguation == nil { + break + } + + return e.complexity.PerformerDraft.Disambiguation(childComplexity), true + case "PerformerDraft.ethnicity": if e.complexity.PerformerDraft.Ethnicity == nil { break @@ -4786,6 +4794,7 @@ input PerformerQueryInput { type PerformerDraft { id: ID name: String! + disambiguation: String aliases: String gender: String birthdate: String @@ -4806,6 +4815,7 @@ type PerformerDraft { input PerformerDraftInput { id: ID + disambiguation: String name: String! aliases: String gender: String @@ -15940,6 +15950,47 @@ func (ec *executionContext) fieldContext_PerformerDraft_name(ctx context.Context return fc, nil } +func (ec *executionContext) _PerformerDraft_disambiguation(ctx context.Context, field graphql.CollectedField, obj *PerformerDraft) (ret graphql.Marshaler) { + fc, err := ec.fieldContext_PerformerDraft_disambiguation(ctx, field) + if err != nil { + return graphql.Null + } + ctx = graphql.WithFieldContext(ctx, fc) + defer func() { + if r := recover(); r != nil { + ec.Error(ctx, ec.Recover(ctx, r)) + ret = graphql.Null + } + }() + resTmp, err := ec.ResolverMiddleware(ctx, func(rctx context.Context) (interface{}, error) { + ctx = rctx // use context from middleware stack in children + return obj.Disambiguation, nil + }) + if err != nil { + ec.Error(ctx, err) + return graphql.Null + } + if resTmp == nil { + return graphql.Null + } + res := resTmp.(*string) + fc.Result = res + return ec.marshalOString2áš–string(ctx, field.Selections, res) +} + +func (ec *executionContext) fieldContext_PerformerDraft_disambiguation(ctx context.Context, field graphql.CollectedField) (fc *graphql.FieldContext, err error) { + fc = &graphql.FieldContext{ + Object: "PerformerDraft", + Field: field, + IsMethod: false, + IsResolver: false, + Child: func(ctx context.Context, field graphql.CollectedField) (*graphql.FieldContext, error) { + return nil, errors.New("field of type String does not have child fields") + }, + } + return fc, nil +} + func (ec *executionContext) _PerformerDraft_aliases(ctx context.Context, field graphql.CollectedField, obj *PerformerDraft) (ret graphql.Marshaler) { fc, err := ec.fieldContext_PerformerDraft_aliases(ctx, field) if err != nil { @@ -32078,7 +32129,7 @@ func (ec *executionContext) unmarshalInputPerformerDraftInput(ctx context.Contex asMap[k] = v } - fieldsInOrder := [...]string{"id", "name", "aliases", "gender", "birthdate", "urls", "ethnicity", "country", "eye_color", "hair_color", "height", "measurements", "breast_type", "tattoos", "piercings", "career_start_year", "career_end_year", "image"} + fieldsInOrder := [...]string{"id", "disambiguation", "name", "aliases", "gender", "birthdate", "urls", "ethnicity", "country", "eye_color", "hair_color", "height", "measurements", "breast_type", "tattoos", "piercings", "career_start_year", "career_end_year", "image"} for _, k := range fieldsInOrder { v, ok := asMap[k] if !ok { @@ -32092,6 +32143,13 @@ func (ec *executionContext) unmarshalInputPerformerDraftInput(ctx context.Contex return it, err } it.ID = data + case "disambiguation": + ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("disambiguation")) + data, err := ec.unmarshalOString2áš–string(ctx, v) + if err != nil { + return it, err + } + it.Disambiguation = data case "name": ctx := graphql.WithPathContext(ctx, graphql.NewPathWithField("name")) data, err := ec.unmarshalNString2string(ctx, v) @@ -38053,6 +38111,8 @@ func (ec *executionContext) _PerformerDraft(ctx context.Context, sel ast.Selecti if out.Values[i] == graphql.Null { atomic.AddUint32(&out.Invalids, 1) } + case "disambiguation": + out.Values[i] = ec._PerformerDraft_disambiguation(ctx, field, obj) case "aliases": out.Values[i] = ec._PerformerDraft_aliases(ctx, field, obj) case "gender": diff --git a/pkg/models/generated_models.go b/pkg/models/generated_models.go index 08f836bfe..5b5fefa80 100644 --- a/pkg/models/generated_models.go +++ b/pkg/models/generated_models.go @@ -283,6 +283,7 @@ type PerformerDestroyInput struct { type PerformerDraftInput struct { ID *uuid.UUID `json:"id,omitempty"` + Disambiguation *string `json:"disambiguation,omitempty"` Name string `json:"name"` Aliases *string `json:"aliases,omitempty"` Gender *string `json:"gender,omitempty"` diff --git a/pkg/models/model_draft.go b/pkg/models/model_draft.go index b0a44f4b4..5bfeb90a4 100644 --- a/pkg/models/model_draft.go +++ b/pkg/models/model_draft.go @@ -46,6 +46,7 @@ func (SceneDraft) IsDraftData() {} type PerformerDraft struct { ID *uuid.UUID `json:"id,omitempty"` Name string `json:"name"` + Disambiguation *string `json:"disambiguation,omitempty"` Aliases *string `json:"aliases,omitempty"` Gender *string `json:"gender,omitempty"` Birthdate *string `json:"birthdate,omitempty"`