X-Git-Url: https://git.sesse.net/?p=pr0n;a=blobdiff_plain;f=perl%2FSesse%2Fpr0n%2FCommon.pm;h=d5e672746a3b8708777cf51e469fa3c037ee31e4;hp=cb02a154c90912ba5e1b7065d2641203497f5801;hb=de8ae1d729f234ffba9e69e65d4b929b6c0d4256;hpb=576c411da9608bb7155e89811694f9f19e542773 diff --git a/perl/Sesse/pr0n/Common.pm b/perl/Sesse/pr0n/Common.pm index cb02a15..d5e6727 100644 --- a/perl/Sesse/pr0n/Common.pm +++ b/perl/Sesse/pr0n/Common.pm @@ -31,7 +31,7 @@ BEGIN { require Sesse::pr0n::Config_local; }; - $VERSION = "v2.04"; + $VERSION = "v2.05"; @ISA = qw(Exporter); @EXPORT = qw(&error &dberror); %EXPORT_TAGS = qw(); @@ -192,8 +192,8 @@ sub update_width_height { # update the last_picture cache as well (this should of course be done # via a trigger, but this is less complicated :-) ) - $dbh->do('UPDATE events SET last_picture=(SELECT COALESCE(MAX(date),\'1970-01-01 00:00:00\') FROM images WHERE event=events.id) WHERE id=(SELECT event FROM images WHERE id=?)', - undef, $id) + $dbh->do('UPDATE last_picture_cache SET last_picture=GREATEST(last_picture, ?) WHERE event=(SELECT event FROM images WHERE id=?)', + undef, $datetime, $id) or die "Couldn't update last_picture in SQL: $!"; } @@ -288,7 +288,6 @@ sub ensure_cached { # NEF files aren't autodetected $fname = "NEF:$fname" if ($filename =~ /\.nef$/i); - $r->log->warn("Generating $fname for $filename"); my $err = $magick->Read($fname); if ($err) { @@ -438,9 +437,11 @@ sub make_infobox { } if (defined($info->{'Flash'})) { - if ($info->{'Flash'} =~ /did not fire/ || $info->{'Flash'} =~ /No Flash/) { + if ($info->{'Flash'} =~ /did not fire/i || + $info->{'Flash'} =~ /no flash/i || + $info->{'Flash'} =~ /not fired/i) { push @lines, "No flash"; - } elsif ($info->{'Flash'} =~ /fired/) { + } elsif ($info->{'Flash'} =~ /fired/i) { push @lines, "Flash"; } else { push @lines, $info->{'Flash'};