Major changes to support interlaced/progressive content
[videoscripts/.git] / organize_videos
index 86047a1a65fdc6785a771e7a86816d134512e12b..e8b02db03b4cc8a213912178f0d829e559be1985 100755 (executable)
@@ -14,7 +14,7 @@ use File::Pid;
 my $srcpathname = "/naspool/pictures/New Photos"; # Path to look for videos to move from
 my $dstpathname = "/naspool/videos/HomeVideos"; # Path to move the videos to
 my $merge_videos_by_day = "/naspool/videos/bin/merge_videos_by_day";
-my $minage = "+30"; # Video file creation dates must not have changed in the last X minutes to process any of the video files
+my $minage = "+0"; # Video file creation dates must not have changed in the last X minutes to process any of the video files
 my $owner = "ajp"; # The owner of the files after they are moved
 my $group = "pip"; # The group of the files after they are moved
 my $mode = "664"; # The mode to set on each file after they are moved
@@ -142,7 +142,7 @@ my $errno = 0;
 my $merge_opts = "";
 if(defined $opt_t) { $merge_opts .= "-t "; }
 if(defined $opt_r) { $merge_opts .= "-r "; }
-$errno=system("$merge_videos_by_day -s \"$srcpathname\" $merge_opts");
+$errno=system("$merge_videos_by_day -q -s \"$srcpathname\" $merge_opts");
 $errno = $errno >> 8;
 if($errno) { die "-E- $merge_videos_by_day encountered some errors with exit code $errno\n"; }
 
@@ -230,7 +230,8 @@ foreach $file (`$find_cmd`) {
          if(! defined $opt_t) { 
              $tmpdir=`tempfile`;
              system("rm $tmpdir");
-             system("mv \"$srcdir\" $tmpdir > /dev/null 2>/dev/null");
+             system("cp -R \"$srcdir\" $tmpdir > /dev/null 2>/dev/null");
+             system("rm -rf \"$srcdir\"");
              print "-> Moved empty subdir $srcdir to $tmpdir\n" if($opt_v);
          }
       }