X-Git-Url: https://code.delx.au/transcoding/blobdiff_plain/0e73df4a0a1266c75f2a83b5b5262d7823d4e28e..8d8caa4e32b955fe175a0f404381602d44f815f1:/rip-dvd diff --git a/rip-dvd b/rip-dvd index 588da09..118b1f2 100755 --- a/rip-dvd +++ b/rip-dvd @@ -11,10 +11,10 @@ fi # Calculate the name for ripping base="$1" last="$(find . -maxdepth 1 -type d -name "${base}*" | sort -n | tail -n 1)" -if [ -z "$last" ]; then - num="1" -elif [ -n "$2" ]; then +if [ -n "$2" ]; then num="$2" +elif [ -z "$last" ]; then + num="1" else num="${last##./${base}}" num="$(($num + 1))" @@ -27,7 +27,7 @@ next="${base}${num}" rm -rf ~/.dvdcss # Need to use libdvdread/libdvdcss to unlock the drive before copying -identify-dvd "$DVD_DEVICE" +identify-disc --dvd-device "$DVD_DEVICE" echo @@ -44,7 +44,7 @@ set -x rm -rf "${next}" "${next}.iso" ddrescue -n -b 2048 "$DVD_DEVICE" "${next}.iso" dvdbackup -n "$next" -M -i "${next}.iso" || true -identify-dvd "$next" +identify-disc --dvd-device "$next" rm "${next}.iso" eject "$DVD_DEVICE"