projects
/
videoscripts
/
.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fixed a few bugs
[videoscripts/.git]
/
organize_videos
diff --git
a/organize_videos
b/organize_videos
index 34fd2e6b66cbcc67ac36b0744905bd375fd77a0c..05edab463cb246cba2357155bd67c6985c5ed1bc 100755
(executable)
--- a/
organize_videos
+++ b/
organize_videos
@@
-67,6
+67,7
@@
sub usage {
print " -d <dir> directory to recreate the playlists in. Only needed if -p option is given\n";
return 1;
}
print " -d <dir> directory to recreate the playlists in. Only needed if -p option is given\n";
return 1;
}
+$SIG{'INT'} = sub {die "-E- Killed by CTRL-C\n"};
sub is_folder_empty {
my $dirname = shift;
sub is_folder_empty {
my $dirname = shift;
@@
-127,9
+128,10
@@
$video_files_found=`$find_cmd_with_mkv`;
if(!$video_files_found) { exit 0; }
# Only proceed if no files have changed in the past $cmin minutes
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; }
+if(! $opt_f) {
+ $changed_files_found=`$find_changed_cmd`;
+ if($changed_files_found) { exit 0; }
+}
# Only one instance of this script running at a time
my $pidfile = File::Pid->new({file => "$pid_file", pid => "$$"});
# Only one instance of this script running at a time
my $pidfile = File::Pid->new({file => "$pid_file", pid => "$$"});
@@
-233,7
+235,6
@@
foreach $file (`$find_mkv`) {
}
$dstfile = "$newfile.$ext";
}
$dstfile = "$newfile.$ext";
-
if(defined $opt_t) {
print "-> Moving \"$srcdir/$srcfile\" to \"$dstfile\"\n";
} else {
if(defined $opt_t) {
print "-> Moving \"$srcdir/$srcfile\" to \"$dstfile\"\n";
} else {