mirror of
https://github.com/stashapp/stash.git
synced 2026-02-08 08:21:32 +01:00
scrapers + stashboxes
This commit is contained in:
parent
027d047c31
commit
602fc96d8a
3 changed files with 39 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue