$dbh->do('INSERT INTO images (id,vhost,event,uploadedby,takenby,filename) VALUES (?,?,?,?,?,?)',
undef, $newid, $r->get_server_name, $event, $user, $takenby, $filename);
- $dbh->do('UPDATE events SET last_update=CURRENT_TIMESTAMP WHERE vhost=? AND event=?',
+ $dbh->do('UPDATE last_picture_cache SET last_update=CURRENT_TIMESTAMP WHERE vhost=? AND event=?',
undef, $r->get_server_name, $event);
+ Sesse::pr0n::Common::purge_cache($r, "/$event/");
# Now save the file to disk
$fname = Sesse::pr0n::Common::get_disk_location($r, $newid);
if ($filename !~ /^\.(_|DS_Store)/) {
# FIXME: Ideally we'd want to ensure cache of -1x-1 here as well (for NEFs), but that would
# preclude mipmapping in its current form.
- Sesse::pr0n::Common::ensure_cached($r, $filename, $newid, undef, undef, 1, 80, 64, 320, 256);
+ Sesse::pr0n::Common::ensure_cached($r, $filename, $newid, undef, undef, "nobox", 80, 64, 320, 256);
}
# OK, we got this far, commit
eval {
$dbh->do('INSERT INTO images (id,vhost,event,uploadedby,takenby,filename) VALUES (?,?,?,?,?,?)',
undef, $newid, $r->get_server_name, $event, $user, $takenby, $filename);
- $dbh->do('UPDATE events SET last_update=CURRENT_TIMESTAMP WHERE vhost=? AND event=?',
+ $dbh->do('UPDATE last_picture_cache SET last_update=CURRENT_TIMESTAMP WHERE vhost=? AND event=?',
undef, $r->get_server_name, $event);
# Now save the file to disk
$dbh->do('DELETE FROM images WHERE vhost=? AND event=? AND filename=?',
undef, $r->get_server_name, $event, $filename)
or dberror($r, "Couldn't remove file");
- $dbh->do('UPDATE events SET last_update=CURRENT_TIMESTAMP WHERE vhost=? AND event=?',
+ $dbh->do('UPDATE last_picture_cache SET last_update=CURRENT_TIMESTAMP WHERE vhost=? AND event=?',
undef, $r->get_server_name, $event)
or dberror($r, "Couldn't invalidate cache");
$r->status(200);