summaryrefslogtreecommitdiff
path: root/lib/VNDB/Handler/Misc.pm
diff options
context:
space:
mode:
authorYorhel <git@yorhel.nl>2011-01-01 18:09:00 +0100
committerYorhel <git@yorhel.nl>2011-01-01 18:09:00 +0100
commitb932e475e9ed2b0b1e89a5954fc1872a131890e0 (patch)
tree17439247f56f8700bfd8aa734baded2c62f4c09a /lib/VNDB/Handler/Misc.pm
parent674cab796b2607c1e4441d0005d96588cedbde29 (diff)
Also apply permanent VN filters to the random screenshots on /
Diffstat (limited to 'lib/VNDB/Handler/Misc.pm')
-rw-r--r--lib/VNDB/Handler/Misc.pm8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/VNDB/Handler/Misc.pm b/lib/VNDB/Handler/Misc.pm
index 671cc017..90a457aa 100644
--- a/lib/VNDB/Handler/Misc.pm
+++ b/lib/VNDB/Handler/Misc.pm
@@ -45,7 +45,13 @@ sub homepage {
lit mt '_home_intro';
end;
- my $scr = $self->dbScreenshotRandom;
+ # with filters applied it's signifcantly slower, so special-code the situations with and without filters
+ my @vns;
+ if($self->authPref('filter_vn')) {
+ my $r = $self->filFetchDB(vn => undef, undef, {hasshot => 1, results => 4, order => 'rand'});
+ @vns = map $_->{id}, @$r;
+ }
+ my $scr = $self->dbScreenshotRandom(@vns);
p class => 'screenshots';
for (@$scr) {
my($w, $h) = imgsize($_->{width}, $_->{height}, @{$self->{scr_size}});