]> mj.ucw.cz Git - gallery.git/blobdiff - gal2/gal-cache
Gallery2: More renames
[gallery.git] / gal2 / gal-cache
index 591a1cee3082e86d1778a06dbf43f63bd70ca8fb..99095075e1b216f81f1993ca550d11045086a3b3 100755 (executable)
@@ -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";