func ScrapedPerformer(qb models.PerformerReader, p *models.ScrapedPerformer, stashBoxEndpoint *string) error {
	if p.StoredID != nil || p.Name == nil {
		return nil
	}

	// Check if a performer with the StashID already exists
	if stashBoxEndpoint != nil && p.RemoteSiteID != nil {
		performers, err := qb.FindByStashID(models.StashID{
			StashID:  *p.RemoteSiteID,
			Endpoint: *stashBoxEndpoint,
		})
		if err != nil {
			return err
		}
		if len(performers) > 0 {
			id := strconv.Itoa(performers[0].ID)
			p.StoredID = &id
			return nil
		}
	}

	performers, err := qb.FindByNames([]string{*p.Name}, true)

	if err != nil {
		return err
	}

	if len(performers) != 1 {
		// ignore - cannot match
		return nil
	}

	id := strconv.Itoa(performers[0].ID)
	p.StoredID = &id
	return nil
}
// ScrapedPerformer matches the provided performer with the
// performers in the database and sets the ID field if one is found.
ScrapedPerformer matches the provided performer with the
performers in the database and sets the ID field if one is found.
// ScrapedPerformer matches the provided performer with the // performers in the database and sets the ID field if one is found .
func ScrapedPerformer(qb models.PerformerReader, p *models.ScrapedPerformer, stashBoxEndpoint *string) error {
	if p.StoredID != nil || p.Name == nil {
		return nil
	}
	if stashBoxEndpoint != nil && p.RemoteSiteID != nil {
		performers, err := qb.FindByStashID(models.StashID{
			StashID:  *p.RemoteSiteID,
			Endpoint: *stashBoxEndpoint,
		})
		if err != nil {
			return err
		}
		if len(performers) > 0 {
			id := strconv.Itoa(performers[0].ID)
			p.StoredID = &id
			return nil
		}
	}
	performers, err := qb.FindByNames([]string{*p.Name}, true)
	if err != nil {
		return err
	}
	if len(performers) != 1 {
		return nil
	}
	id := strconv.Itoa(performers[0].ID)
	p.StoredID = &id
	return nil
}
func ScrapedPerformer ( qb models . PerformerReader , p * models . ScrapedPerformer , stashBoxEndpoint * string ) error { if p . StoredID != nil || p . Name == nil { return nil } if stashBoxEndpoint != nil && p . RemoteSiteID != nil { performers , err := qb . FindByStashID ( models . StashID { StashID : * p . RemoteSiteID , Endpoint : * stashBoxEndpoint , } ) if err != nil { return err } if len ( performers ) > 0 { id := strconv . Itoa ( performers [ 0 ] . ID ) p . StoredID = & id return nil } } performers , err := qb . FindByNames ( [ ] string { * p . Name } , true ) if err != nil { return err } if len ( performers ) != 1 { return nil } id := strconv . Itoa ( performers [ 0 ] . ID ) p . StoredID = & id return nil }
ScrapedPerformer matches the provided performer with the
performers in the database and sets the ID field if one is found.
ScrapedPerformer matches the provided performer with the performers in the database and sets the ID field if one is found .
// Check if a performer with the StashID already exists // ignore - cannot match