]> mj.ucw.cz Git - gallery.git/commitdiff
Gallery2: Use generators of meta file names
authorMartin Mares <mj@ucw.cz>
Sat, 29 Dec 2012 19:07:56 +0000 (20:07 +0100)
committerMartin Mares <mj@ucw.cz>
Sun, 8 Feb 2015 20:14:16 +0000 (21:14 +0100)
gal2/UCW/Gallery.pm
gal2/bin/gal-cache
gal2/bin/gal-gen

index ee84087c9d95a73367ca73bb9068415883369d76..3912868a2f61e4e13f51f16957dd1b2436070eb0 100644 (file)
@@ -148,7 +148,6 @@ sub read_meta($) {
        return $meta;
 }
 
-# FIXME: Use everywhere
 sub photo_meta_name($) {
        my ($self) = @_;
        return File::Spec->catfile($self->get('PhotoDir'), 'gallery.meta');
index f53437de22c64c553176d471dd4e0d0c324dd769..da9a29132dfbab2ec26aa96ca95737970e3350d8 100755 (executable)
@@ -19,7 +19,7 @@ print "Reading gallery.list\n";
 my $orig_list = $gal->read_list('gallery.list') or die "Cannot read gallery.list: $!\n";
 
 my $photo_dir = $gal->get('PhotoDir');
-my $photo_meta = File::Spec->catfile($photo_dir, 'gallery.meta');
+my $photo_meta = $gal->photo_meta_name;
 print "Reading meta-data from $photo_meta\n";
 -f $photo_meta or die "Cannot load $photo_meta\n";
 my $meta = $gal->read_meta($photo_meta);
@@ -88,6 +88,6 @@ for my $thumb_fmt (keys %{$gal->get('ThumbFormats')}) {
        }
 }
 
-my $cache_meta = File::Spec->catfile($cache_dir, 'cache.meta');
+my $cache_meta = $gal->cache_meta_name;
 print "Writing meta-data to $cache_meta\n";
 $gal->write_meta($cache_meta, $meta);
index 14a40d0888a1a748363d0998c9fb8e2a5ab61128..4658de5a723dff17a62a8d14d03ec8064bd104b7 100755 (executable)
@@ -25,7 +25,7 @@ if (-d $photo_dir) {
        File::Path::mkpath($photo_dir) or die "Unable to create $photo_dir: $!\n";
 }
 
-my $photo_meta = $photo_dir . "/gallery.meta";
+my $photo_meta = $gal->photo_meta_name;
 my $old_meta = {};
 if (-f $photo_meta) {
        print "Reading old meta-data\n";