...
 
Commits (3)
......@@ -15,6 +15,12 @@ function debug() {
return 0
}
# Get the media device mount point (UDF format)
# return MOUNT_PATH
get_mount_point () {
MOUNT_PATH=$(mount | grep udf | sed 's/ type.*$//' | cut -d ' ' -f3-)
}
# Iso file management
# need ISO_FILE_PATH
#
......@@ -42,7 +48,8 @@ iso_manage () {
udisksctl loop-setup -r -f "${ISO_FILE_PATH}"
fi
# Get mount point
ISO_MOUNT_POINT=$(mount | grep udf | sed 's/ type udf //g' | cut -d '(' -f 1 | awk '{print $NF}')
get_mount_point
ISO_MOUNT_POINT="${MOUNT_PATH}"
fi
;;
umount )
......@@ -62,6 +69,11 @@ iso_manage () {
#
# return MEDIA_DEVICE_TYPE
get_media_device_type () {
if [ -d "${MOUNT_PATH}/VIDEO_TS" ]; then
MEDIA_DEVICE_TYPE="DVD"
debug "MEDIA_DEVICE_TYPE ${MEDIA_DEVICE_TYPE}"
return 0
fi
check_mediainfo
MEDIA_FORMAT_FULL=$(mediainfo --Inform="General;%Format%" "${MOUNT_PATH}" 2> /dev/null)
debug "MEDIA_FORMAT_FULL ${MEDIA_FORMAT_FULL}"
......
......@@ -548,7 +548,7 @@ DVD | ISO_DVD )
else
DVD_MOUNT_PATH="${DVD_PATH}"
fi
debug "BD_MOUNT ${BD_MOUNT}"
debug "DVD_MOUNT_PATH ${DVD_MOUNT_PATH}"
# Compare the provided media device type with the detected one
MOUNT_PATH="${DVD_MOUNT_PATH}"
......
......@@ -260,7 +260,7 @@ fi
case "${SOURCE}" in
BD )
# Compare the provided media device type with the detected one
MOUNT_PATH=$(mount | grep udf | sed 's/ type udf //g' | cut -d '(' -f 1 | awk '{print $NF}')
get_mount_point
get_media_device_type
if [[ ! "${MEDIA_DEVICE_TYPE}" == "BD" ]]; then
MESSAGE_NOGOODMEDIA=$(gettext "Media device not recognized as Blu-Ray but as ${MEDIA_DEVICE_TYPE} !")
......@@ -322,7 +322,7 @@ case "${SOURCE}" in
;;
DVD )
# Compare the provided media device type with the detected one
MOUNT_PATH=$(mount | grep udf | sed 's/ type udf //g' | cut -d '(' -f 1 | awk '{print $NF}')
get_mount_point
get_media_device_type
if [[ ! "${MEDIA_DEVICE_TYPE}" == "DVD" ]]; then
MESSAGE_NOGOODMEDIA=$(gettext "Media device not recognized as DVD but as ${MEDIA_DEVICE_TYPE} !")
......