Commit 431a0e06 authored by Booloki's avatar Booloki

bdchapters output change since v0.5 + Chaptering management factorization

parent 51b52335
Pipeline #547 failed with stages
in 13 minutes and 50 seconds
......@@ -32,13 +32,14 @@ FUNCTIONS_PRE="${FUNCTIONS_PATH}/wazzuf-pre"
FUNCTIONS_AUDIO_FILE="${FUNCTIONS_PATH}/wazzuf-audio"
FUNCTIONS_VIDEO_FILE="${FUNCTIONS_PATH}/wazzuf-video"
FUNCTIONS_SUBTITLES_FILE="${FUNCTIONS_PATH}/wazzuf-subtitle"
FUNCTIONS_CHAPTERS_FILE="${FUNCTIONS_PATH}/wazzuf-chaptering"
FUNCTIONS_COVERART_FILE="${FUNCTIONS_PATH}/wazzuf-coverart"
FUNCTIONS_XMLTAG_FILE="${FUNCTIONS_PATH}/wazzuf-xmltag"
FUNCTIONS_COMMON="${FUNCTIONS_PATH}/wazzuf-common"
FUNCTIONS_NFO="${FUNCTIONS_PATH}/wazzuf-nfo"
FUNCTIONS_IMDB="${FUNCTIONS_PATH}/wazzuf-imdb"
WAZZUF_FILES="${FUNCTIONS_PRE} ${FUNCTIONS_AUDIO_FILE} ${FUNCTIONS_VIDEO_FILE} ${FUNCTIONS_SUBTITLES_FILE} ${FUNCTIONS_COVERART_FILE} ${FUNCTIONS_XMLTAG_FILE} ${FUNCTIONS_COMMON} ${FUNCTIONS_NFO} ${FUNCTIONS_IMDB}"
WAZZUF_FILES="${FUNCTIONS_PRE} ${FUNCTIONS_AUDIO_FILE} ${FUNCTIONS_VIDEO_FILE} ${FUNCTIONS_SUBTITLES_FILE} ${FUNCTIONS_CHAPTERS_FILE} ${FUNCTIONS_COVERART_FILE} ${FUNCTIONS_XMLTAG_FILE} ${FUNCTIONS_COMMON} ${FUNCTIONS_NFO} ${FUNCTIONS_IMDB}"
## DENOMINATIONS
......
#!/bin/bash
## chapters functions
# video_dvd_chapters_extract
# need TITLE_NUMBER
# DVDXCHAP_DEVICE
# DVDXCHAP_CHAPTERS
# WAZZUF_UI
#
# return CHAPTERS_FILE_TXT
video_dvd_chapters_extract () {
# Save chapters informations (DVD/ISO_DVD only)
if [[ "${WAZZUF_UI}" == "GUI" ]]; then
debug "( dvdxchap -t \"${TITLE_NUMBER}\" ${DVDXCHAP_CHAPTERS} \"${DVDXCHAP_DEVICE}\" > \"${CHAPTERS_FILE_TXT}\" ) | zenity --progress --pulsate --title \"${ZEN_TITLE}\" --text \"Creating ${CHAPTERS_FILE_TXT} from ${SOURCE}\" --auto-close"
# shellcheck disable=SC2086
( dvdxchap -t "${TITLE_NUMBER}" ${DVDXCHAP_CHAPTERS} "${DVDXCHAP_DEVICE}" > "${CHAPTERS_FILE_TXT}" ) \
| zenity --progress --pulsate --title "${ZEN_TITLE}" --text "Creating ${CHAPTERS_FILE_TXT} from ${SOURCE}" --auto-close --auto-kill
else
echo -ne "\n *************************************\n"
echo " Creating ${CHAPTERS_FILE_TXT} from ${SOURCE}..."
debug "dvdxchap -t \"${TITLE_NUMBER}\" ${DVDXCHAP_CHAPTERS} \"${DVDXCHAP_DEVICE}\" > \"${CHAPTERS_FILE_TXT}\""
# shellcheck disable=SC2086
dvdxchap -t "${TITLE_NUMBER}" ${DVDXCHAP_CHAPTERS} "${DVDXCHAP_DEVICE}" > "${CHAPTERS_FILE_TXT}"
fi
}
# video_bd_chapters_extract
# need MPLS_FILE
# WAZZUF_UI
#
# return nothing
video_bd_chapters_extract () {
# Save chapters informations (BD/M2TS only)
debug "bdchapters -i \"${MPLS_FILE}\" -o ."
if [[ "${WAZZUF_UI}" == "GUI" ]]; then
( echo 10; bdchapters -i "${MPLS_FILE}" -o . 1>/dev/null ) \
| zenity --progress --pulsate --auto-close \
--title "${ZEN_TITLE}" \
--text "${MESSAGE_GENERATION}"
if [ $? = "1" ]; then wazzuf_quit; fi
else
printf "${WAZZUF_SEPARATOR_HEAD}"
printf "${MESSAGE_GENERATION}\n"
bdchapters -i "${MPLS_FILE}" -o . || exit 1
printf "${WAZZUF_SEPARATOR_FOOT}"
fi
}
#!/bin/bash
## video encode function
# video_dvd_chapters_extract
# need TITLE_NUMBER
# DVDXCHAP_DEVICE
# DVDXCHAP_CHAPTERS
# WAZZUF_UI
#
# return CHAPTERS_FILE_TXT
video_dvd_chapters_extract () {
# Save chapters informations (DVD/ISO_DVD only)
if [[ "${WAZZUF_UI}" == "GUI" ]]; then
debug "( dvdxchap -t \"${TITLE_NUMBER}\" ${DVDXCHAP_CHAPTERS} \"${DVDXCHAP_DEVICE}\" > \"${CHAPTERS_FILE_TXT}\" ) | zenity --progress --pulsate --title \"${ZEN_TITLE}\" --text \"Creating ${CHAPTERS_FILE_TXT} from ${SOURCE}\" --auto-close"
# shellcheck disable=SC2086
( dvdxchap -t "${TITLE_NUMBER}" ${DVDXCHAP_CHAPTERS} "${DVDXCHAP_DEVICE}" > "${CHAPTERS_FILE_TXT}" ) \
| zenity --progress --pulsate --title "${ZEN_TITLE}" --text "Creating ${CHAPTERS_FILE_TXT} from ${SOURCE}" --auto-close --auto-kill
else
echo -ne "\n *************************************\n"
echo " Creating ${CHAPTERS_FILE_TXT} from ${SOURCE}..."
debug "dvdxchap -t \"${TITLE_NUMBER}\" ${DVDXCHAP_CHAPTERS} \"${DVDXCHAP_DEVICE}\" > \"${CHAPTERS_FILE_TXT}\""
# shellcheck disable=SC2086
dvdxchap -t "${TITLE_NUMBER}" ${DVDXCHAP_CHAPTERS} "${DVDXCHAP_DEVICE}" > "${CHAPTERS_FILE_TXT}"
fi
}
# video_vob_dump
# need TITLE_NUMBER
# MPLAYER_VOB_DUMP_DEVICE
......
......@@ -623,28 +623,18 @@ time for TITLE_NUMBER in ${TITLE_LIST}; do
# Chapters management
if [[ ! "${WAZZUF_UI}" == "GUI" ]]; then printf "${WAZZUF_SEPARATOR_HEAD}"; fi
# CHAPTERS_FILE_XML filename can not be choosen (bdchapters)
CHAPTERS_FILE_XML=$(basename "${M2TS_FILE_PATH//m2ts/xml}")
if [ -f "${CHAPTERS_FILE_XML}" ]; then
FILE_NAME="${CHAPTERS_FILE_XML}"
file_exists
MESSAGE_GENERATION=$(printf "$(gettext "%s generation")" "${CHAPTERS_FILE_XML}")
MERGE_CHAPTERS="--chapters ${CHAPTERS_FILE_XML}"
else
MPLS_FILE="${M2TS_FILE_PATH//m2ts$/mpls}"
MPLS_FILE="${M2TS_FILE_PATH//m2ts/mpls}"
if [ -f "${MPLS_FILE}" ]; then
check_bdchapters
debug "bdchapters -i \"${MPLS_FILE}\" -o \"${CHAPTERS_FILE_XML}\""
if [[ "${WAZZUF_UI}" == "GUI" ]]; then
( echo 10; bdchapters -i "${MPLS_FILE}" -o "${CHAPTERS_FILE_XML}" 1>/dev/null ) \
| zenity --progress --pulsate --auto-close \
--title "${ZEN_TITLE}" \
--text "${MESSAGE_GENERATION}"
if [ $? = "1" ]; then wazzuf_quit; fi
else
printf "${WAZZUF_SEPARATOR_HEAD}"
printf "${MESSAGE_GENERATION}\n"
bdchapters -i "${MPLS_FILE}" -o "${CHAPTERS_FILE_XML}"
printf "${WAZZUF_SEPARATOR_FOOT}"
fi
video_bd_chapters_extract
MERGE_CHAPTERS="--chapters ${CHAPTERS_FILE_XML}"
else
MESSAGE_NOCHAPTERS=$(gettext "No chapters file to create. Next...")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment