Fixed some bugs found in re-testing
[videoscripts/.git] / merge_videos_by_day
index 6dce13c1eb54d88f48b340c8693622ddceb1ef07..4cf293ddea47cbd2b699faf4febcaa0fbe22fff7 100755 (executable)
@@ -282,14 +282,15 @@ foreach $ext (sort keys %videos) {
            my $errno = system("$cmd");
            $errno = $errno >> 8;
            if($errno) { die "-E- make_mkv encountered some errors with exit code $errno\n"; }
+           system("ls -l \"$srcpathname/\" > /dev/null"); # Make sure the video file is there
            # Fix the permissions
            system("chown $owner \"$video\"");
            system("chgrp $group \"$video\"");
            system("chmod $mode \"$video\"");
            # Remove the individual video files
            if(!defined $opt_k) { 
-               foreach $video (@{$videos{$ext}{$video}}) {
-                   system("rm -f $video");
+               foreach $srcvideo (@{$videos{$ext}{$video}}) {
+                   system("rm -f $srcvideo");
                }
            }
        }