summaryrefslogtreecommitdiff
path: root/lib/VNDB/DB/VN.pm
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2019-06-28 15:31:43 +0200
committerYorhel <git@yorhel.nl>2019-06-28 15:31:45 +0200
commita91d48ac617b758a8310c28e91b73e23dae90963 (patch)
tree3613ca657a3c9e709ff35e0b94606fa9d83f95b1 /lib/VNDB/DB/VN.pm
parent670c294ff6efeead61e215679224604848229c82 (diff)
VNBrowse: Add character filters
This is a bit experimental, not sure how the performance is going to be.
Diffstat (limited to 'lib/VNDB/DB/VN.pm')
-rw-r--r--lib/VNDB/DB/VN.pm8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/VNDB/DB/VN.pm b/lib/VNDB/DB/VN.pm
index a057b166..2933fbfd 100644
--- a/lib/VNDB/DB/VN.pm
+++ b/lib/VNDB/DB/VN.pm
@@ -13,7 +13,7 @@ our @EXPORT = qw|dbVNGet dbVNGetRev dbVNRevisionInsert dbVNImageId dbScreenshotA
# Options: id, char, search, length, lang, olang, plat, tag_inc, tag_exc, tagspoil,
# hasani, hasshot, ul_notblack, ul_onwish, results, page, what, sort,
-# reverse, inc_hidden, date_before, date_after, released, release
+# reverse, inc_hidden, date_before, date_after, released, release, character
# What: extended anime staff seiyuu relations screenshots relgraph rating ranking wishlist vnlist
# Note: wishlist and vnlist are ignored (no db search) unless a user is logged in
# Sort: id rel pop rating title tagscore rand
@@ -82,6 +82,12 @@ sub dbVNGet {
[ 'NOT r.hidden' => 1, $self->dbReleaseFilters(%{$o{release}}), ];
push @where, $q, \@p;
}
+ if($o{character}) {
+ my($q, @p) = sqlprint
+ 'v.id IN(SELECT cv.vid FROM chars c JOIN chars_vns cv ON cv.id = c.id !W)',
+ [ 'NOT c.hidden' => 1, $self->dbCharFilters(%{$o{character}}) ];
+ push @where, $q, \@p;
+ }
my @join = (
$o{what} =~ /relgraph/ ?