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 -1S "$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
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 {
if [[ "$ripper" == "makemkv" ]]; then
# use makemkv to make an MKV file of the disk
make_dvd_mkv_image "$tmpdir/$dvdname.mkv" "disc" "$makemkv_disc_id"
+ echo " Moving $tmpdir/$dvdname.mkv -> $dest/$dvdname.mkv"
mv "$tmpdir/$dvdname.mkv" "$dest/$dvdname.mkv"
# add this video data to the mythtv DB
fill_mythvideo_metadata "$dest_filename"
else
# use ddrescue to make an ISO image of the disk
make_dvd_iso_image "$tmpdir/$dvdname.iso"
+ echo " Moving $tmpdir/$dvdname.mkv -> $dest/$dvdname.mkv"
mv "$tmpdir/$dvdname.iso" "$dest/$dvdname.iso"
# add this video data to the mythtv DB
fill_mythvideo_metadata "$dest_filename"