diff options
author | Yorhel <git@yorhel.nl> | 2021-07-28 13:50:50 +0200 |
---|---|---|
committer | Yorhel <git@yorhel.nl> | 2021-07-28 13:50:52 +0200 |
commit | 2644fe6bfcafa8489afae0ef1455cdeddb91c09b (patch) | |
tree | 5d9e34093df78a2429671c659648afc3a6787167 /lib | |
parent | fde850392cc8edcd7d498267577c8c4f17a15dda (diff) |
AdvSearch: Add character birthday filter
Only exact matches for now, and the UI's a bit ugly.
w/e it works, ship it.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/VNWeb/AdvSearch.pm | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/VNWeb/AdvSearch.pm b/lib/VNWeb/AdvSearch.pm index 7e610fd6..82030ffd 100644 --- a/lib/VNWeb/AdvSearch.pm +++ b/lib/VNWeb/AdvSearch.pm @@ -415,6 +415,8 @@ f c => 12 => 'age', { required => 0, default => undef, uint => 1, max => f c => 13 => 'trait', { type => 'any', func => \&_validate_trait }, compact => sub { my $id = ($_->[0] =~ s/^i//r)*1; $_->[1] == 0 ? $id : [ $id, int $_->[1] ] }, sql_list => \&_sql_where_trait; +f c => 14 => 'birthday', { type => 'array', length => 2, values => { uint => 1, max => 31 } }, + '=' => sub { sql 'c.b_month =', \$_->[0], $_->[1] ? ('AND c.b_day =', \$_->[1]) : () }; # XXX: When this field is nested inside a VN query, it may match seiyuu linked to other VNs. # This can be trivially fixed by adding an (AND vs.id = v.id) clause, but that results in extremely slow queries that I've no clue how to optimize. |