Fixed various actor filters. Improved tag bar scroll behavior.

This commit is contained in:
2024-03-24 18:16:10 +01:00
parent 3f266630b4
commit 28a91efd33
6 changed files with 39 additions and 18 deletions

View File

@@ -367,12 +367,24 @@ async function queryManticoreSql(filters, options, _reqUser) {
builder.whereRaw('match(\'@name :query:\', actors)', { query: filters.query });
}
['gender', 'country'].forEach((attribute) => {
// attribute filters
['country'].forEach((attribute) => {
if (filters[attribute]) {
builder.where(attribute, filters[attribute]);
}
});
if (filters.gender === 'other') {
builder.whereNull('gender');
} else if (filters.gender) {
builder.where('gender', filters.gender);
}
if (filters.age) {
builder.select('if(date_of_birth, floor((now() - date_of_birth) / 31556952), 0) as age');
}
// range filters
['age', 'height'].forEach((attribute) => {
if (filters[attribute]) {
builder
@@ -396,9 +408,11 @@ async function queryManticoreSql(filters, options, _reqUser) {
const month = filters.dateOfBirth.getMonth() + 1;
const day = filters.dateOfBirth.getDate();
builder.select('month(date_of_birth) as month_of_birth, day(date_of_birth) as day_of_birth');
builder
.where('month(date_of_birth)', month)
.where('day(date_of_birth)', day);
.where('month_of_birth', month)
.where('day_of_birth', day);
}
if (filters.cup) {