X-Git-Url: http://git.pippins.net/embedvideo/.git/.%24link.?a=blobdiff_plain;f=rip_dvd;h=0035a2d284ad8ec25a20e895a4296027cce22503;hb=f95d0312d13f205bbdc5e30312095c0133f44b36;hp=e096655b18ccd0a39fe728274ac2540558a8b0dc;hpb=268b77327ea62e9ce8bd065a716bb3c851b96176;p=rip_dvd%2F.git diff --git a/rip_dvd b/rip_dvd index e096655..0035a2d 100755 --- a/rip_dvd +++ b/rip_dvd @@ -1157,16 +1157,30 @@ function make_dvd_mkv_image { echo -e "\n Ripping: $makemkv --minlength=$min_length --decrypt --progress=-same $srctype:$srcname all $dstdir" mkdir -p "$dstdir" - $makemkv mkv --minlength=$min_length --decrypt --progress=-same $srctype:$srcname all $dstdir + $makemkv mkv --minlength=$min_length --decrypt --progress=-same $srctype:$srcname all $dstdir 2>&1 | tee -a "$ddrescuelog" makemkv_retval=$? if [ $makemkv_retval != 0 ]; then fatal_and_exit "-E- Unhandled makemkv error" fi - # Move the created MKV file into place - echo -e "\n Moving $dstdir/*.mkv -> $dstmkv" - mv "$dstdir"/*.mkv "$dstmkv" + # Move the largest created MKV file into place + # There might be multiple ones, so just grab the largest one + largest_mkv_file=`/bin/ls -rS "$dstdir"/*.mkv | head -1` + echo -e "\n Moving largest mkv file $largest_mkv_file -> $dstmkv\n" | tee -a "$ddrescuelog" + mv "$largest_mkv_file" "$dstmkv" + + # Move all of the created MKV file into place + #echo "\n" | tee -a "$ddrescuelog" + #dstfile=${dstmkv%.[^.]*} + #typeset -i num=0 + #for i in `/bin/ls -1 "$dstdir"/*.mkv`; do + #echo -e " Moving $i -> $dstfile.$num.mkv" | tee -a "$ddrescuelog" + #mv "$i" "$dstfile.$num.mkv" + #((num = num + 1 )) + #done + #echo "\n" | tee -a "$ddrescuelog" + if [ $? != 0 ]; then fatal_and_exit "-E- Unhandled mv error" fi @@ -1175,7 +1189,7 @@ function make_dvd_mkv_image { fi # Concatenate the encode log to our main log file, greping out unwanted lines - cat $encodelog | grep -v "Current progress:" >> "$logfile" + cat "$ddrescuelog" | grep -v "Current progress:" >> "$logfile" } function make_dvd_mkv_image_from_folder {