summaryrefslogtreecommitdiff
path: root/lib/VNDB/DB
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2019-12-29 10:11:18 +0100
committerYorhel <git@yorhel.nl>2019-12-29 10:11:20 +0100
commit40ef00116cc12aef4ce08fc1136e329c58abda4b (patch)
tree92b73b8786e2aa927f0510cdcb1ad66e86ccd2da /lib/VNDB/DB
parentf18f6925d52029fd5e55585a627cf07052798dd7 (diff)
ulist: Display labels on VN browser
Replaces the old "wishlist status" column that I removed earlier. It's kind of awkward, but at least the functionality still exists now.
Diffstat (limited to 'lib/VNDB/DB')
-rw-r--r--lib/VNDB/DB/VN.pm8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/VNDB/DB/VN.pm b/lib/VNDB/DB/VN.pm
index afc64282..d099b6ff 100644
--- a/lib/VNDB/DB/VN.pm
+++ b/lib/VNDB/DB/VN.pm
@@ -255,6 +255,14 @@ sub _enrich {
}
}
+ VNWeb::DB::enrich_flatten(vnlist_labels => id => vid => sub { VNWeb::DB::sql('
+ SELECT uvl.vid, ul.label
+ FROM ulist_vns_labels uvl
+ JOIN ulist_labels ul ON ul.uid = uvl.uid AND ul.id = uvl.lbl
+ WHERE uvl.uid =', \$self->authInfo->{id}, 'AND uvl.vid IN', $_[0], '
+ ORDER BY CASE WHEN ul.id < 10 THEN ul.id ELSE 10 END, ul.label'
+ )}, $r) if $what =~ /vnlist/ && $self->authInfo->{id};
+
return wantarray ? ($r, $np) : $r;
}