From 70d3ba3c710f3fe234188d492b42338aa2069513 Mon Sep 17 00:00:00 2001 From: Alan Pippin Date: Mon, 24 Sep 2012 00:02:28 -0600 Subject: [PATCH] Fixed some bugs found in re-testing --- merge_videos_by_day | 5 +++-- organize_videos | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/merge_videos_by_day b/merge_videos_by_day index 6dce13c..4cf293d 100755 --- a/merge_videos_by_day +++ b/merge_videos_by_day @@ -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"); } } } diff --git a/organize_videos b/organize_videos index 4e1ad7f..5625f8b 100755 --- a/organize_videos +++ b/organize_videos @@ -197,7 +197,7 @@ foreach $file (`$find_cmd_with_mkv`) { # We are ready to pick a destination folder to put the video in $dstdir = $dstpathname . "/" . $year; - $dstdirs[$dstdir] = 1; + $dstdirs{$dstdir} = 1; $dstfile = $dstdir . "/" . $year . "-" . $monthnum . "-" . $day; # Check for duplicate filenames at the destination -- 2.34.1