From 602fc96d8a758a32dca3de95eba4111d0ba53abd Mon Sep 17 00:00:00 2001 From: Gykes <24581046+Gykes@users.noreply.github.com> Date: Sun, 21 Dec 2025 22:00:08 -0800 Subject: [PATCH] scrapers + stashboxes --- .../schema/types/scraped-performer.graphql | 8 ++++++-- pkg/models/model_scraped_item.go | 14 +++++++++++++ pkg/stashbox/performer.go | 20 ++++++++++++++++++- 3 files changed, 39 insertions(+), 3 deletions(-) diff --git a/graphql/schema/types/scraped-performer.graphql b/graphql/schema/types/scraped-performer.graphql index 487c89516..799b5cd6e 100644 --- a/graphql/schema/types/scraped-performer.graphql +++ b/graphql/schema/types/scraped-performer.graphql @@ -18,7 +18,9 @@ type ScrapedPerformer { fake_tits: String penis_length: String circumcised: String - career_length: String + career_length: String @deprecated(reason: "Use career_start and career_end") + career_start: String + career_end: String tattoos: String piercings: String # aliases must be comma-delimited to be parsed correctly @@ -54,7 +56,9 @@ input ScrapedPerformerInput { fake_tits: String penis_length: String circumcised: String - career_length: String + career_length: String @deprecated(reason: "Use career_start and career_end") + career_start: String + career_end: String tattoos: String piercings: String aliases: String diff --git a/pkg/models/model_scraped_item.go b/pkg/models/model_scraped_item.go index 4254a9876..212aac577 100644 --- a/pkg/models/model_scraped_item.go +++ b/pkg/models/model_scraped_item.go @@ -177,6 +177,8 @@ type ScrapedPerformer struct { PenisLength *string `json:"penis_length"` Circumcised *string `json:"circumcised"` CareerLength *string `json:"career_length"` + CareerStart *string `json:"career_start"` + CareerEnd *string `json:"career_end"` Tattoos *string `json:"tattoos"` Piercings *string `json:"piercings"` Aliases *string `json:"aliases"` @@ -222,6 +224,18 @@ func (p *ScrapedPerformer) ToPerformer(endpoint string, excluded map[string]bool if p.CareerLength != nil && !excluded["career_length"] { ret.CareerLength = *p.CareerLength } + if p.CareerStart != nil && !excluded["career_start"] { + cs, err := strconv.Atoi(*p.CareerStart) + if err == nil { + ret.CareerStart = &cs + } + } + if p.CareerEnd != nil && !excluded["career_end"] { + ce, err := strconv.Atoi(*p.CareerEnd) + if err == nil { + ret.CareerEnd = &ce + } + } if p.Country != nil && !excluded["country"] { ret.Country = *p.Country } diff --git a/pkg/stashbox/performer.go b/pkg/stashbox/performer.go index 38824eba1..9144a20f7 100644 --- a/pkg/stashbox/performer.go +++ b/pkg/stashbox/performer.go @@ -231,6 +231,16 @@ func performerFragmentToScrapedPerformer(p graphql.PerformerFragment) *models.Sc sp.Height = &hs } + if p.CareerStartYear != nil { + cs := strconv.Itoa(*p.CareerStartYear) + sp.CareerStart = &cs + } + + if p.CareerEndYear != nil { + ce := strconv.Itoa(*p.CareerEndYear) + sp.CareerEnd = &ce + } + if p.BirthDate != nil { sp.Birthdate = padFuzzyDate(p.BirthDate) } @@ -388,7 +398,15 @@ func (c Client) SubmitPerformerDraft(ctx context.Context, performer *models.Perf aliases := strings.Join(performer.Aliases.List(), ",") draft.Aliases = &aliases } - if performer.CareerLength != "" { + // Use CareerStart and CareerEnd directly if available + if performer.CareerStart != nil { + draft.CareerStartYear = performer.CareerStart + } + if performer.CareerEnd != nil { + draft.CareerEndYear = performer.CareerEnd + } + // Fall back to parsing CareerLength for backwards compatibility + if draft.CareerStartYear == nil && draft.CareerEndYear == nil && performer.CareerLength != "" { var career = strings.Split(performer.CareerLength, "-") if i, err := strconv.Atoi(strings.TrimSpace(career[0])); err == nil { draft.CareerStartYear = &i