From f6ac176798628842d70f993c03b4f4978bccbef1 Mon Sep 17 00:00:00 2001 From: Mark Wooding Date: Wed, 21 Jun 2023 10:51:34 +0100 Subject: [PATCH] mason/dhandler (.contact): Determine the `count' strings in advance. Rather than saving the raw statistics and determining the presentation later, just work out the presentation early. We're going to have multiple sizes of thumbnails in contact pages soon, and determining the presentation for each thumbnail size would be pointless. --- mason/dhandler | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/mason/dhandler b/mason/dhandler index 0c834b9..78f0f95 100755 --- a/mason/dhandler +++ b/mason/dhandler @@ -85,14 +85,19 @@ Failed to find ‘<% $path |h %>’. my $size = "medthumb"; my %tn; - my (%nd, %nf); + my %count; for my $f (@$ff) { $tn{$f} = TrivGal::Image->new($path . $f->name)->scale($size); } for my $d (@$dd) { my $p = join_paths $path, $d->name; my ($ddd, $fff, $iii); ($ddd, $fff, $iii) = listdir join_paths $IMGROOT, $p; - $nd{$d} = @$ddd; $nf{$d} = @$fff; + + my $count = ""; + $count .= scalar(@$ddd) . "/" if @$ddd; + $count .= scalar(@$fff) if @$fff; + $count{$d} = $count; + DIR: for (;;) { if (defined $iii) { my $index = join_paths $p, $iii->name; @@ -125,14 +130,11 @@ Failed to find ‘<% $path |h %>’. % if (@$dd) {

Subfolders

% } -- 2.11.0