mirror of https://github.com/stashapp/stash.git
check for '0001-01-01' in death_date (#3784)
This commit is contained in:
parent
1c59d91690
commit
241aae9100
|
@ -758,7 +758,7 @@ func performerAgeFilterCriterionHandler(age *models.IntCriterionInput) criterion
|
|||
return func(ctx context.Context, f *filterBuilder) {
|
||||
if age != nil && age.Modifier.IsValid() {
|
||||
clause, args := getIntCriterionWhereClause(
|
||||
"cast(IFNULL(strftime('%Y.%m%d', performers.death_date), strftime('%Y.%m%d', 'now')) - strftime('%Y.%m%d', performers.birthdate) as int)",
|
||||
"cast(strftime('%Y.%m%d',CASE WHEN performers.death_date IS NULL OR performers.death_date = '0001-01-01' OR performers.death_date = '' THEN 'now' ELSE performers.death_date END) - strftime('%Y.%m%d', performers.birthdate) as int)",
|
||||
*age,
|
||||
)
|
||||
f.addWhere(clause, args...)
|
||||
|
|
Loading…
Reference in New Issue