X-Git-Url: http://git.pippins.net/embedvideo/.git/static/gitweb.js?a=blobdiff_plain;f=organize_videos;h=f666e84f0eb56660e2b8bea198d5824d161253bf;hb=5a32fa802ac2f30553b33cd2c4ed9a935f13839d;hp=4e1ad7ff95bd95c29ffb28cd442304680a820592;hpb=c91b8b9feda0a1fc3221cffd3e28cee33e919b5a;p=videoscripts%2F.git diff --git a/organize_videos b/organize_videos index 4e1ad7f..f666e84 100755 --- a/organize_videos +++ b/organize_videos @@ -101,7 +101,12 @@ sub create_playlists { print " Skipping $file since we can't extract the year and month from it\n"; } } - } + + # Fix the permissions + system("chown $owner \"$dstdir/\"*.$playlist_extension"); + system("chgrp $group \"$dstdir/\"*.$playlist_extension"); + system("chmod $mode \"$dstdir/\"*.$playlist_extension"); + } } # Sanity checks / Option processing @@ -137,7 +142,9 @@ my $errno = 0; my $merge_opts = ""; if(defined $opt_t) { $merge_opts .= "-t "; } if(defined $opt_k) { $merge_opts .= "-k "; } -$errno=system("$merge_videos_by_day -q -s \"$srcpathname\" $merge_opts"); +if($requantize_input_video) { $merge_opts .= ' -q'; } +if($recompress_input_video) { $merge_opts .= ' -z'; } +$errno=system("$merge_videos_by_day -s \"$srcpathname\" $merge_opts"); $errno = $errno >> 8; if($errno) { die "-E- $merge_videos_by_day encountered some errors with exit code $errno\n"; } @@ -197,7 +204,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 @@ -216,7 +223,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";