X-Git-Url: https://git.sesse.net/?p=pr0n;a=blobdiff_plain;f=perl%2FSesse%2Fpr0n%2FIndex.pm;h=3597deeaff849d37d19cacffd3da4d9a4ce9eb08;hp=08491bb775830224f4e99a2d281c46a0276e0853;hb=3bde4ccddbb9473fff56752d7100332d48affa1a;hpb=44c1611c549b7987e2394988e6bc66b1ad72d203;ds=sidebyside diff --git a/perl/Sesse/pr0n/Index.pm b/perl/Sesse/pr0n/Index.pm index 08491bb..3597dee 100644 --- a/perl/Sesse/pr0n/Index.pm +++ b/perl/Sesse/pr0n/Index.pm @@ -150,14 +150,14 @@ sub handler { my ($date, $name); if ($event eq '+all' || defined($tag)) { - $ref = $dbh->selectrow_hashref("SELECT EXTRACT(EPOCH FROM MAX(last_update)) AS last_update FROM events WHERE vhost=?", + $ref = $dbh->selectrow_hashref("SELECT EXTRACT(EPOCH FROM MAX(last_update)) AS last_update FROM last_picture_cache WHERE vhost=?", undef, $r->get_server_name) or error($r, "Could not list events", 404, "File not found"); $date = undef; $name = Sesse::pr0n::Templates::fetch_template($r, 'all-event-title'); $r->set_last_modified($ref->{'last_update'}); } else { - $ref = $dbh->selectrow_hashref("SELECT name,date,EXTRACT(EPOCH FROM last_update) AS last_update FROM events WHERE vhost=? AND event=?", + $ref = $dbh->selectrow_hashref("SELECT name,date,EXTRACT(EPOCH FROM last_update) AS last_update FROM events NATURAL JOIN last_picture_cache WHERE vhost=? AND event=?", undef, $r->get_server_name, $event) or error($r, "Could not find event $event", 404, "File not found");