diff options
Diffstat (limited to 'lib/VNDB/Handler/Misc.pm')
-rw-r--r-- | lib/VNDB/Handler/Misc.pm | 8 |
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}}); |