diff --git a/root/scripts/video-pp.bash b/root/scripts/video-pp.bash index 874ee87..ccc740e 100644 --- a/root/scripts/video-pp.bash +++ b/root/scripts/video-pp.bash @@ -1,57 +1,61 @@ #!/usr/bin/with-contenv bash +TITLESHORT="VPP" set -e -# start +Configuration () { + log "############################################ DOCKER $TITLE" + log "############################################ SCRIPT Video Post Processor ($TITLESHORT)" + log "############################################ SCRIPT VERSION 1.0.0" + log "############################################ DOCKER VERSION $VERSION" + log "############################################ CONFIGURATION VERIFICATION" + + log "TITLESHORT: Required Audio/Subtitle Language: ${VIDEO_LANG}" + if [ ${VIDEO_MKVCLEANER} = TRUE ]; then + log "$TITLESHORT: MKV Cleaner: ENABLED" + else + log "$TITLESHORT: MKV Cleaner: DISABLED" + fi + if [ ${VIDEO_SMA} = TRUE ]; then + log "TITLESHORT: Sickbeard MP4 Automator (SMA): Tagging: ENABLED" + if [ ${VIDEO_SMA_TAGGING} = TRUE ]; then + tagging="-a" + log "TITLESHORT: Sickbeard MP4 Automator (SMA): Tagging: ENABLED" + else + tagging="-nt" + log "TITLESHORT: Sickbeard MP4 Automator (SMA): Tagging: DISABLED" + fi + else + log "TITLESHORT:: Sickbeard MP4 Automator (SMA): DISABLED" + fi + + if [ -z "VIDEO_SMA_TAGGING" ]; then + VIDEO_SMA_TAGGING=FALSE + fi +} -echo "" +Configuration log () { m_time=`date "+%F %T"` echo $m_time" "$1 } -# check for video files -if find "$1" -type f -iregex ".*/.*\.\(mkv\|mp4\|avi\)" | read; then - sleep 0.1 -else - echo "ERROR: No video files found for processing" - exit 1 -fi - -echo "Script Configuration:" -echo "Required Audio/Subtitle Language: ${VIDEO_LANG}" -if [ ${VIDEO_MKVCLEANER} = TRUE ]; then - echo "Video Post Processing with MKV Cleaner: ENABLED" -else - echo "Video Post Processing with MKV Cleaner: DISABLED" -fi -if [ ${VIDEO_SMA} = TRUE ]; then - echo "Video Post Processing with SMA: ENABLED" - if [ ${VIDEO_SMA_TAGGING} = TRUE ]; then - echo "Video Post Processing with SMA Tagging: ENABLED" - fi -else - echo "Video Post Processing with SMA: DISABLED" -fi - -echo "" if [ ${VIDEO_SMA} = TRUE ]; then touch "$1/sma-conversion-check" elif [ ${VIDEO_MKVCLEANER} = TRUE ]; then touch "$1/sma-conversion-check" fi -if [ -z "VIDEO_SMA_TAGGING" ]; then - VIDEO_SMA_TAGGING=FALSE -fi - -if [ ${VIDEO_SMA_TAGGING} = TRUE ]; then - tagging="-a" +# check for video files +if find "$1" -type f -iregex ".*/.*\.\(mkv\|mp4\|avi\)" | read; then + sleep 0.1 else - tagging="-nt" + echo "ERROR: No video files found for processing" + exit 1 fi + filecount=$(find "$1" -type f -iregex ".*/.*\.\(mkv\|mp4\|avi\)" | wc -l) echo "Processing ${filecount} video files..." count=0