Fixed bug in how dates were extracted from video files
[videoscripts/.git] / organize_movies
index 290f37ce36f011422880c1bfcf7da11a5b6c980f..f2c92151eefffc04a063496b72e0bde533403f60 100755 (executable)
@@ -32,7 +32,7 @@ exit if $pidfile->running();
 $pidfile->write();
 
 # Encode the movies
-encode_movies($mobile_movie_src_dir, $mobile_movie_dst_dir);
+#encode_movies($mobile_movie_src_dir, $mobile_movie_dst_dir);
 encode_movies($movie_src_dir, $movie_dst_dir);
 
 sub encode_movies {
@@ -56,6 +56,7 @@ sub encode_movies {
            my $stat = stat("$movie");
            if($stat->mtime < ($now - $minage*60)) {
                my ($base, $dir, $ext) = fileparse($movie,'\..*');
+                $base =~ s/_t\d+$//g; # remove any extra title numbers from the name
                my $output = "$movie_dst_dir/$category/$base.mkv";
                print "-> Encoding $movie => $output\n";
                my $date = `date`; chomp $date;