From: Alan J. Pippin Date: Wed, 1 Feb 2012 05:31:51 +0000 (-0700) Subject: Tweaked makemkv rip logic to only copy back the largest created mkv file X-Git-Url: http://git.pippins.net/embedvideo/.git/%22%22.%24thumbnail.%22/.%24link.?a=commitdiff_plain;h=f95d0312d13f205bbdc5e30312095c0133f44b36;p=rip_dvd%2F.git Tweaked makemkv rip logic to only copy back the largest created mkv file --- diff --git a/rip_dvd b/rip_dvd index af108dd..0035a2d 100755 --- a/rip_dvd +++ b/rip_dvd @@ -1164,14 +1164,23 @@ function make_dvd_mkv_image { fatal_and_exit "-E- Unhandled makemkv error" fi - # Move the created MKV file into place - dstfile=${dstmkv%.[^.]*} - typeset -i num=0 - for i in `/bin/ls -1 "$dstdir"/*.mkv`; do - echo -e "\n Moving $i -> $dstfile.$num.mkv" | tee -a "$ddrescuelog" - mv "$i" "$dstfile.$num.mkv" - ((num = num + 1 )) - done + # 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