Make sure rotation and selection invalidate the listing cache.
authorSteinar H. Gunderson <sesse@debian.org>
Fri, 5 Jan 2007 21:19:41 +0000 (22:19 +0100)
committerSteinar H. Gunderson <sesse@debian.org>
Fri, 5 Jan 2007 21:19:41 +0000 (22:19 +0100)
perl/Sesse/pr0n/Index.pm
perl/Sesse/pr0n/Rotate.pm
perl/Sesse/pr0n/Select.pm

index de0e3bf2f640c1df5b0aafea98041ecad1da09e4..41b4db1689d1be44e5fadb64c416beb5e78d533c 100644 (file)
@@ -159,6 +159,7 @@ sub handler {
                # Print out all thumbnails
                if ($rot == 1) {
                        $r->print("    <form method=\"post\" action=\"/rotate\">\n");
+                       $r->print("      <input type=\"hidden\" name=\"event\" value=\"$event\" />\n");
                
                        while (my $ref = $q->fetchrow_hashref()) {
                                my $imgsz = "";
index 59103e70241fdd373b6486909af96adb7887e17b..9cf18d8ef69ed8f790ced723733a812366730838 100644 (file)
@@ -63,6 +63,10 @@ sub handler {
                        }
                }
        }
+       
+       my $event = $apr->param('event');
+       $dbh->do('UPDATE events SET last_update=CURRENT_TIMESTAMP WHERE id=?', undef, $event)
+               or dberror($r, "Cache invalidation failed");
 
        Sesse::pr0n::Common::footer($r);
 
index 777e02b37cd3adc236f1ef7d161afc0eb0e2c4bb..21dca6a662611418a828abe2d4d06647e0de432d 100644 (file)
@@ -44,6 +44,9 @@ sub handler {
                }
        }
 
+       $dbh->do('UPDATE events SET last_update=CURRENT_TIMESTAMP WHERE id=?', undef, $event)
+               or dberror($r, "Cache invalidation failed");
+
        Sesse::pr0n::Common::footer($r);
 
        return Apache2::Const::OK;