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:
departure18
2023-05-24 04:19:35 +01:00
committed by GitHub
parent 58a6c22072
commit 776c7e6c35
52 changed files with 1051 additions and 184 deletions

View File

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