Update video-pp.bash

pull/11/head
RandomNinjaAtk 4 years ago committed by GitHub
parent 17f6ce4157
commit 3934514057
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1,57 +1,61 @@
#!/usr/bin/with-contenv bash #!/usr/bin/with-contenv bash
TITLESHORT="VPP"
set -e 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"
echo "" 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
}
Configuration
log () { log () {
m_time=`date "+%F %T"` m_time=`date "+%F %T"`
echo $m_time" "$1 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 if [ ${VIDEO_SMA} = TRUE ]; then
touch "$1/sma-conversion-check" touch "$1/sma-conversion-check"
elif [ ${VIDEO_MKVCLEANER} = TRUE ]; then elif [ ${VIDEO_MKVCLEANER} = TRUE ]; then
touch "$1/sma-conversion-check" touch "$1/sma-conversion-check"
fi fi
if [ -z "VIDEO_SMA_TAGGING" ]; then # check for video files
VIDEO_SMA_TAGGING=FALSE if find "$1" -type f -iregex ".*/.*\.\(mkv\|mp4\|avi\)" | read; then
fi sleep 0.1
if [ ${VIDEO_SMA_TAGGING} = TRUE ]; then
tagging="-a"
else else
tagging="-nt" echo "ERROR: No video files found for processing"
exit 1
fi fi
filecount=$(find "$1" -type f -iregex ".*/.*\.\(mkv\|mp4\|avi\)" | wc -l) filecount=$(find "$1" -type f -iregex ".*/.*\.\(mkv\|mp4\|avi\)" | wc -l)
echo "Processing ${filecount} video files..." echo "Processing ${filecount} video files..."
count=0 count=0

Loading…
Cancel
Save