my $dir = "/naspool/videos/HomeVideos";
my $plsfile = "$dir/Random.pls";
-my $avifiles = "????/????-??-??.avi";
+my $mkvfiles = "????/*.mkv";
chdir $dir || die "Couldn't change directory!\n";
system "rm -f $plsfile";
-@files = `ls -1 $avifiles`;
+@files = `ls -1 $mkvfiles`;
@shuffled = shuffle(@files);
open (FILE, ">$plsfile") || die "Couldn't open $plsfile!\n";
print FILE @shuffled;
#!/bin/bash
DROPBOX="/naspool/dropbox/New Movies"
-MOVIEDIR="/naspool/movies"
+MOVIEDIR="/movpool/movies"
MOVIE="$1"
CATEGORY="$2"
foreach $video (@{$videos{$ext}{$video}}) {
if(($save_originals) && ($video =~ /\.$originals_file_ext/)) {
print "-> Saving the original video $video\n";
- print("mv $video \"$origpathname/".basename(dirname($video))."_".basename($video)."\n");
+ if(index($video, basename(dirname($video))) == -1) {
+ print("mv $video \"$origpathname/".basename(dirname($video))."_".basename($video)."\n");
+ } else {
+ print("mv $video \"$origpathname/".basename($video)."\n");
+ }
} else {
print "-> Removing the original video $video\n";
print("/bin/bash -c '[[ -e $video ]] && rm -f $video'\n");
foreach $srcvideo (@{$videos{$ext}{$video}}) {
if(($save_originals) && ($srcvideo =~ /\.$originals_file_ext/)) {
print "-> Saving the original video $srcvideo to $origpathname\n";
- system("mv $srcvideo \"$origpathname/".basename(dirname($srcvideo))."_".basename($srcvideo));
+ if(index($srcvideo, basename(dirname($srcvideo))) == -1) {
+ system("mv $srcvideo \"$origpathname/".basename(dirname($srcvideo))."_".basename($srcvideo));
+ } else {
+ system("mv $srcvideo \"$origpathname/".basename($srcvideo));
+ }
} else {
print "-> Removing the original video $srcvideo\n";
system("/bin/bash -c '[[ -e $srcvideo ]] && rm -f $srcvideo'");
# Configuration parameters
my $movie_src_dir = "/naspool/dropbox/New Movies";
my $mobile_movie_src_dir = "/naspool/dropbox/New Movies/Mobile";
-my $movie_dst_dir = "/naspool/movies";
-my $mobile_movie_dst_dir = "/naspool/movies/Mobile";
+my $movie_dst_dir = "/movpool/movies";
+my $mobile_movie_dst_dir = "/movpool/movies/Mobile";
my $movie_done_dir = "/naspool/dropbox/Encoded";
my $log = "/var/log/organize/organize_movies.log";
my $encode_log = "/var/log/organize/organize_movies_encode.log";
"12" => "Dec"
);
-getopts("htvnkpd:");
+getopts("htvnkpfd:");
sub usage {
- print "usage: $0 [-v] [-t] [-r] [-p] [-d <dir>]\n";
+ print "usage: $0 [-v] [-t] [-r] [-p] [-f] [-d <dir>]\n";
print " -v verbose; print file being moved (to).\n";
print " -t test; print what will happen, but don't do anything\n";
+ print " -f force it to run by ignoring the \$minage setting in organize_videos.conf\n";
print " -n do not copy to dest; do not copy the resultant video files to the destination dir\n";
print " -k keep the individual video files that are merged. By default, after a merge, individual video files that were merged are removed\n";
print " -p only recreate video playlists, do not process any video files. Do this for each year & month of video clips in the directory specified by -d <dir>.\n";
if(!$video_files_found) { exit 0; }
# Only proceed if no files have changed in the past $cmin minutes
+if($opt_f) { $find_changed_cmd =~ s/cmin \S+ /cmin +0 /; }
$changed_files_found=`$find_changed_cmd`;
if($changed_files_found) { exit 0; }