summaryrefslogtreecommitdiff
path: root/lib/Multi/API.pm
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2016-05-15 10:42:56 +0200
committerYorhel <git@yorhel.nl>2016-05-15 10:42:56 +0200
commitd56eb10d90387a86f0cd94fddd1fa0b007d5af10 (patch)
tree6f189cb63d54965eaa1b259fd8166d8419a6cf0d /lib/Multi/API.pm
parent9f99f7ffda4a0fee6c7cf6ec181f8c3077de2803 (diff)
API: Allow sorting 'get vn' on stats fields
Diffstat (limited to 'lib/Multi/API.pm')
-rw-r--r--lib/Multi/API.pm5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Multi/API.pm b/lib/Multi/API.pm
index b73ec58c..2b35d0d3 100644
--- a/lib/Multi/API.pm
+++ b/lib/Multi/API.pm
@@ -381,6 +381,9 @@ my %GET_VN = (
id => 'v.id %s',
title => 'v.title %s',
released => 'v.c_released %s',
+ popularity => 'v.c_popularity %s NULLS LAST',
+ rating => 'v.c_rating %s NULLS LAST',
+ votecount => 'v.c_votecount %s',
},
flags => {
basic => {
@@ -785,7 +788,7 @@ my %GET_CHARACTER = (
fetch => [[ 'id', 'SELECT id, vid, rid, spoil, role FROM chars_vns WHERE id IN(%s)',
sub { my($n, $r) = @_;
for my $i (@$n) {
- $i->{vns} = [ map [ $_->{vid}*1, $_->{rid}*1, $_->{spoil}*1, $_->{role} ], grep $i->{id} == $_->{id}, @$r ];
+ $i->{vns} = [ map [ $_->{vid}*1, ($_->{rid}||0)*1, $_->{spoil}*1, $_->{role} ], grep $i->{id} == $_->{id}, @$r ];
}
},
]],