X-Git-Url: https://git.sesse.net/?p=pr0n;a=blobdiff_plain;f=perl%2Fupdate-image-cache.pl;h=213a7a0cb1ee6b14386161357762e699ad6b6318;hp=8a19841edf2e8307e6146efc74fa28fc99c2c0aa;hb=45ee05e19e1039e74e2b7ca4955b007d2cd3ed69;hpb=acc5b53241d0e971595d6017c60f54a6bc057c41 diff --git a/perl/update-image-cache.pl b/perl/update-image-cache.pl index 8a19841..213a7a0 100755 --- a/perl/update-image-cache.pl +++ b/perl/update-image-cache.pl @@ -101,7 +101,6 @@ while (my $ref = $q->fetchrow_hashref) { if (!$regen_mipmaps) { @files = grep { !/mipmap/ } @files; } - my @bothres = (); my @boxres = (); my @noboxres = (); my $any_old = 0; @@ -110,9 +109,7 @@ while (my $ref = $q->fetchrow_hashref) { if ($mtime < $threshold) { $any_old = 1; } - if ($c =~ /$id-(\d+)-(\d+)\.jpg/ || $c =~ /$id-(-1)-(-1)\.jpg/) { - push @bothres, [$1, $2]; - } elsif ($c =~ /$id-(\d+)-(\d+)-nobox\.jpg/ || $c =~ /$id-(-1)-(-1)-nobox\.jpg/) { + if ($c =~ /$id-(\d+)-(\d+)-nobox\.jpg/ || $c =~ /$id-(-1)-(-1)-nobox\.jpg/) { push @noboxres, [$1, $2]; } elsif ($c =~ /$id-(\d+)-(\d+)-box\.png/ || $c =~ /$id-(-1)-(-1)-box\.png/) { push @boxres, [$1, $2]; @@ -120,14 +117,11 @@ while (my $ref = $q->fetchrow_hashref) { } next unless $any_old; unlink (@files); - if (scalar @bothres > 0) { - Sesse::pr0n::Common::ensure_cached($r, $ref->{'filename'}, $id, $ref->{'width'}, $ref->{'height'}, 'both', 1, sort_res(@bothres)); - } if (scalar @noboxres > 0) { - Sesse::pr0n::Common::ensure_cached($r, $ref->{'filename'}, $id, $ref->{'width'}, $ref->{'height'}, 'nobox', 1, sort_res(@noboxres)); + Sesse::pr0n::Common::ensure_cached($r, $ref->{'filename'}, $id, $ref->{'width'}, $ref->{'height'}, 1, sort_res(@noboxres)); } if (scalar @boxres > 0) { - Sesse::pr0n::Common::ensure_cached($r, $ref->{'filename'}, $id, $ref->{'width'}, $ref->{'height'}, 'box', 1, sort_res(@boxres)); + Sesse::pr0n::Common::ensure_infobox_cached($r, $ref->{'filename'}, $id, $ref->{'width'}, $ref->{'height'}, 1, sort_res(@boxres)); } my @newfiles = glob("../cache/$dir/$id-*.jpg");