scrapers + stashboxes

This commit is contained in:
Gykes 2025-12-21 22:00:08 -08:00
parent 027d047c31
commit 602fc96d8a
3 changed files with 39 additions and 3 deletions

View file

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

View file

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

View file

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