X-Git-Url: http://mj.ucw.cz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=gal2%2Fgal-cache;h=99095075e1b216f81f1993ca550d11045086a3b3;hb=9616a1f03e8290d15f0d15def6c8fb6d4e9420bf;hp=591a1cee3082e86d1778a06dbf43f63bd70ca8fb;hpb=a6d0d32eec237d41a55b9e54b88969d156c3458f;p=gallery.git diff --git a/gal2/gal-cache b/gal2/gal-cache index 591a1ce..9909507 100755 --- a/gal2/gal-cache +++ b/gal2/gal-cache @@ -18,6 +18,9 @@ STDOUT->autoflush(1); UCW::Gallery::LoadConfig; +print "Reading gallery.list\n"; +my $orig_list = UCW::Gallery::ReadList('gallery.list') or die "Cannot read gallery.list: $!\n"; + my $photo_dir = $CF{'PhotoDir'}; my $photo_meta = File::Spec->catfile($photo_dir, 'gallery.meta'); print "Reading meta-data from $photo_meta\n"; @@ -32,6 +35,14 @@ if (-d $cache_dir) { print "Creating cache directory: $cache_dir\n"; File::Path::mkpath($cache_dir) or die "Unable to create $cache_dir: $!\n"; +# Construct sequence and store photo titles +$meta->{sequence} = []; +for my $f (@$orig_list) { + push @{$meta->{sequence}}, $f->{id}; + my $m = $meta->{photo}->{$f->{id}} or die; + $m->{title} = $f->{title}; +} + for my $thumb_fmt (keys %{$CF{'ThumbFormats'}}) { my ($tw, $th) = ($thumb_fmt =~ m{^(\d+)x(\d+)$}) or die "Cannot parse thumbnail format $thumb_fmt\n"; print "Generating $thumb_fmt thumbnails\n";