X-Git-Url: http://git.pippins.net/embedvideo/.git/static/gitweb.js?a=blobdiff_plain;f=organize_videos;h=ef49df53054ec8a2dcbaf479d3dc121d09f19dfa;hb=64702de206d3356a3d80acf75b572bd9c31c86d9;hp=5727d57c6e4da119668975640cdb389bdc5d8d59;hpb=9990cf64d87333417ab72d6e106fa53df6ad2943;p=videoscripts%2F.git diff --git a/organize_videos b/organize_videos index 5727d57..ef49df5 100755 --- a/organize_videos +++ b/organize_videos @@ -190,6 +190,14 @@ foreach $file (`$find_cmd_with_mkv`) { $monthnum = $month; $monthname = lc($month2monthname{$month}); } + # Get the date taken from the source directory + elsif($srcdir =~ /(\d+)-(\d+)-(\d+)/) { + $year = $1; + $month = $2; + $day = sprintf("%02d",$3); + $monthnum = $month; + $monthname = lc($month2monthname{$month}); + } # Get the date taken from the modification time elsif($date_taken =~ /\S+\s+(\S+)\s+(\d+)\s+\S+\s+(\d+)/) { $year = $3; @@ -223,7 +231,7 @@ foreach $file (`$find_cmd_with_mkv`) { print "-> Moving \"$srcdir/$srcfile\" to \"$dstfile\"\n"; } else { # Make sure the destination directories exist - $errno=system("mkdir -p \"$dstdir\""); + $errno=system("mkdir -p -m $dirmode \"$dstdir\""); if($errno) { print "-E- Error creating dstdir: $dstdir\n"; next; } # Perform the move operation from $srcdir/$srcfile -> $dstfile print "-> Moving \"$srcdir/$srcfile\" to \"$dstfile\"\n";