From b1fb6569af96cc6d1872198b960cb2d4fef9ecdd Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Sat, 29 Dec 2012 20:07:56 +0100 Subject: [PATCH] Gallery2: Use generators of meta file names --- gal2/UCW/Gallery.pm | 1 - gal2/bin/gal-cache | 4 ++-- gal2/bin/gal-gen | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/gal2/UCW/Gallery.pm b/gal2/UCW/Gallery.pm index ee84087..3912868 100644 --- a/gal2/UCW/Gallery.pm +++ b/gal2/UCW/Gallery.pm @@ -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'); diff --git a/gal2/bin/gal-cache b/gal2/bin/gal-cache index f53437d..da9a291 100755 --- a/gal2/bin/gal-cache +++ b/gal2/bin/gal-cache @@ -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); diff --git a/gal2/bin/gal-gen b/gal2/bin/gal-gen index 14a40d0..4658de5 100755 --- a/gal2/bin/gal-gen +++ b/gal2/bin/gal-gen @@ -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"; -- 2.39.2