1.4 - use new settings

This commit is contained in:
RandomNinjaAtk
2023-07-19 17:45:41 -04:00
committed by GitHub
parent ed9066e3f6
commit c0a3d33142

View File

@@ -1,5 +1,5 @@
#!/usr/bin/with-contenv bash
ScriptVersion="1.3"
ScriptVersion="1.4"
scriptName="Audiobook"
#### Import Settings
@@ -10,6 +10,13 @@ log () {
echo $m_time" :: $scriptName :: $ScriptVersion :: "$1
}
if [ -z $allowM4b ]; then
allowM4b=true
fi
if [ -z $allowMp3 ]; then
allowMp3=false
fi
set -e
set -o pipefail
@@ -94,6 +101,22 @@ if [ "$bookfound" == "false" ]; then
fi
fi
if [ "$allowM4b" != "true" ];
if [ $allowM4b -gt 0 ]; then
log "M4B's disabled via config file, performing cleanup..."
rm "$1"/*
error="true"
fi
fi
if [ "$allowMp3" != "true" ];
if [ $mp3Count -gt 0 ]; then
log "MP3's disabled via config file, performing cleanup..."
rm "$1"/*
error="true"
fi
fi
if [ "$error" == "true" ]; then
echo "ERROR: No audiobook files found" && exit 1
fi