summaryrefslogtreecommitdiff
path: root/lib/Multi/API.pm
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2020-04-16 09:42:01 +0200
committerYorhel <git@yorhel.nl>2020-04-16 09:42:04 +0200
commitbe0aafedcd48d86a408a6310c331330a9229e08d (patch)
tree35704a2fd6fa1d27f2ca42ca7135686289c18b54 /lib/Multi/API.pm
parent074d00452f5e1a18decd80068d18e602e857f674 (diff)
API: get ulist: Always return and allow filtering on label 7 (Voted)
This allows filtering on (label=7) even when the user has set that label to private and that label will now also be returned with the 'labels' flag. The $ULIST_PUBLIC check in the main query will ensure that only public VNs are included in the results.
Diffstat (limited to 'lib/Multi/API.pm')
-rw-r--r--lib/Multi/API.pm4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Multi/API.pm b/lib/Multi/API.pm
index 518d32bc..a3280fc9 100644
--- a/lib/Multi/API.pm
+++ b/lib/Multi/API.pm
@@ -1150,7 +1150,7 @@ my %GET_ULIST = (
labels => {
fetch => [[ ['uid','vn'], 'SELECT uvl.uid, uvl.vid, ul.id, ul.label
FROM ulist_vns_labels uvl JOIN ulist_labels ul ON ul.uid = uvl.uid AND ul.id = uvl.lbl
- WHERE (uvl.uid,uvl.vid) IN(%s) AND (NOT ul.private OR uvl.uid = %s)',
+ WHERE (uvl.uid,uvl.vid) IN(%s) AND (NOT ul.private OR uvl.uid = %s OR uvl.lbl = 7)',
sub { my($n, $r) = @_;
for my $i (@$n) {
$i->{labels} = [ grep $i->{uid} == $_->{uid} && $i->{vn} == $_->{vid}, @$r ];
@@ -1169,7 +1169,7 @@ my %GET_ULIST = (
vn => $VN_FILTER,
label => [
[ 'int' => 'EXISTS(SELECT 1 FROM ulist_vns_labels uvl JOIN ulist_labels ul ON ul.uid = uvl.uid AND ul.id = uvl.lbl
- WHERE uvl.uid = uv.uid AND uvl.vid = uv.vid AND uvl.lbl = :value: AND NOT ul.private)', {'=',1}, range => [1,1e6] ],
+ WHERE uvl.uid = uv.uid AND uvl.vid = uv.vid AND uvl.lbl = :value: AND (uvl.lbl = 7 OR NOT ul.private))', {'=',1}, range => [1,1e6] ],
],
},
);