]> mj.ucw.cz Git - gallery.git/blobdiff - gal2/bin/gal-gen
Gallery2: Let mj-digikam call mj-init if needed
[gallery.git] / gal2 / bin / gal-gen
index 6c767d83bec756f67d5c3119435c6fd6cc5314cb..94c291b5da8a198ef5106f067bdfaca413d445d6 100755 (executable)
@@ -119,5 +119,15 @@ for my $f (@$orig_list) {
        print "... OK\n";
 }
 
+print "Cleaning up stale files\n";
+for my $f (<$photo_dir/*.jpg>) {
+       my ($vv, $dd, $id) = File::Spec->splitpath($f);
+       $id =~ s{\..*$}{};
+       unless (defined $meta->{photo}->{$id}) {
+               print "$id: removing\n";
+               unlink $f;
+       }
+}
+
 print "Writing meta-data\n";
 $gal->write_meta($photo_meta, $meta);