mirror of
https://github.com/stashapp/stash.git
synced 2025-12-17 04:14:39 +03:00
Change performer height to be numeric (#3060)
* Make height an int. Add height_cm field * Change UI to use height_cm * Use number fields for height/weight * Add migration note
This commit is contained in:
@@ -85,12 +85,30 @@ type StringCriterionInput struct {
|
||||
Modifier CriterionModifier `json:"modifier"`
|
||||
}
|
||||
|
||||
func (i StringCriterionInput) ValidModifier() bool {
|
||||
switch i.Modifier {
|
||||
case CriterionModifierEquals, CriterionModifierNotEquals, CriterionModifierIncludes, CriterionModifierExcludes, CriterionModifierMatchesRegex, CriterionModifierNotMatchesRegex,
|
||||
CriterionModifierIsNull, CriterionModifierNotNull:
|
||||
return true
|
||||
}
|
||||
|
||||
return false
|
||||
}
|
||||
|
||||
type IntCriterionInput struct {
|
||||
Value int `json:"value"`
|
||||
Value2 *int `json:"value2"`
|
||||
Modifier CriterionModifier `json:"modifier"`
|
||||
}
|
||||
|
||||
func (i IntCriterionInput) ValidModifier() bool {
|
||||
switch i.Modifier {
|
||||
case CriterionModifierEquals, CriterionModifierNotEquals, CriterionModifierGreaterThan, CriterionModifierLessThan, CriterionModifierIsNull, CriterionModifierNotNull, CriterionModifierBetween, CriterionModifierNotBetween:
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
type ResolutionCriterionInput struct {
|
||||
Value ResolutionEnum `json:"value"`
|
||||
Modifier CriterionModifier `json:"modifier"`
|
||||
|
||||
@@ -11,15 +11,16 @@ import (
|
||||
)
|
||||
|
||||
type Performer struct {
|
||||
Name string `json:"name,omitempty"`
|
||||
Gender string `json:"gender,omitempty"`
|
||||
URL string `json:"url,omitempty"`
|
||||
Twitter string `json:"twitter,omitempty"`
|
||||
Instagram string `json:"instagram,omitempty"`
|
||||
Birthdate string `json:"birthdate,omitempty"`
|
||||
Ethnicity string `json:"ethnicity,omitempty"`
|
||||
Country string `json:"country,omitempty"`
|
||||
EyeColor string `json:"eye_color,omitempty"`
|
||||
Name string `json:"name,omitempty"`
|
||||
Gender string `json:"gender,omitempty"`
|
||||
URL string `json:"url,omitempty"`
|
||||
Twitter string `json:"twitter,omitempty"`
|
||||
Instagram string `json:"instagram,omitempty"`
|
||||
Birthdate string `json:"birthdate,omitempty"`
|
||||
Ethnicity string `json:"ethnicity,omitempty"`
|
||||
Country string `json:"country,omitempty"`
|
||||
EyeColor string `json:"eye_color,omitempty"`
|
||||
// this should be int, but keeping string for backwards compatibility
|
||||
Height string `json:"height,omitempty"`
|
||||
Measurements string `json:"measurements,omitempty"`
|
||||
FakeTits string `json:"fake_tits,omitempty"`
|
||||
|
||||
@@ -18,7 +18,7 @@ type Performer struct {
|
||||
Ethnicity string `json:"ethnicity"`
|
||||
Country string `json:"country"`
|
||||
EyeColor string `json:"eye_color"`
|
||||
Height string `json:"height"`
|
||||
Height *int `json:"height"`
|
||||
Measurements string `json:"measurements"`
|
||||
FakeTits string `json:"fake_tits"`
|
||||
CareerLength string `json:"career_length"`
|
||||
@@ -50,7 +50,7 @@ type PerformerPartial struct {
|
||||
Ethnicity OptionalString
|
||||
Country OptionalString
|
||||
EyeColor OptionalString
|
||||
Height OptionalString
|
||||
Height OptionalInt
|
||||
Measurements OptionalString
|
||||
FakeTits OptionalString
|
||||
CareerLength OptionalString
|
||||
|
||||
@@ -79,8 +79,10 @@ type PerformerFilterType struct {
|
||||
Country *StringCriterionInput `json:"country"`
|
||||
// Filter by eye color
|
||||
EyeColor *StringCriterionInput `json:"eye_color"`
|
||||
// Filter by height
|
||||
// Filter by height - deprecated: use height_cm instead
|
||||
Height *StringCriterionInput `json:"height"`
|
||||
// Filter by height in centimeters
|
||||
HeightCm *IntCriterionInput `json:"height_cm"`
|
||||
// Filter by measurements
|
||||
Measurements *StringCriterionInput `json:"measurements"`
|
||||
// Filter by fake tits value
|
||||
|
||||
Reference in New Issue
Block a user