mirror of
https://github.com/stashapp/stash.git
synced 2025-12-18 04:44:37 +03:00
Add penis length and circumcision stats to performers. (#3627)
* Add penis length stat to performers. * Modified the UI to display and edit the stat. * Added the ability to filter floats to allow filtering by penis length. * Add circumcision stat to performer. * Refactor enum filtering * Change boolean filter to radio buttons * Return null for empty enum values --------- Co-authored-by: WithoutPants <53250216+WithoutPants@users.noreply.github.com>
This commit is contained in:
@@ -23,7 +23,6 @@ func ToJSON(ctx context.Context, reader ImageAliasStashIDGetter, performer *mode
|
||||
newPerformerJSON := jsonschema.Performer{
|
||||
Name: performer.Name,
|
||||
Disambiguation: performer.Disambiguation,
|
||||
Gender: performer.Gender.String(),
|
||||
URL: performer.URL,
|
||||
Ethnicity: performer.Ethnicity,
|
||||
Country: performer.Country,
|
||||
@@ -43,6 +42,14 @@ func ToJSON(ctx context.Context, reader ImageAliasStashIDGetter, performer *mode
|
||||
UpdatedAt: json.JSONTime{Time: performer.UpdatedAt},
|
||||
}
|
||||
|
||||
if performer.Gender != nil {
|
||||
newPerformerJSON.Gender = performer.Gender.String()
|
||||
}
|
||||
|
||||
if performer.Circumcised != nil {
|
||||
newPerformerJSON.Circumcised = performer.Circumcised.String()
|
||||
}
|
||||
|
||||
if performer.Birthdate != nil {
|
||||
newPerformerJSON.Birthdate = performer.Birthdate.String()
|
||||
}
|
||||
@@ -61,6 +68,10 @@ func ToJSON(ctx context.Context, reader ImageAliasStashIDGetter, performer *mode
|
||||
newPerformerJSON.Weight = *performer.Weight
|
||||
}
|
||||
|
||||
if performer.PenisLength != nil {
|
||||
newPerformerJSON.PenisLength = *performer.PenisLength
|
||||
}
|
||||
|
||||
if err := performer.LoadAliases(ctx, reader); err != nil {
|
||||
return nil, fmt.Errorf("loading performer aliases: %w", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user