Update video.bash

This commit is contained in:
RandomNinjaAtk 2023-07-07 10:52:52 -04:00 committed by GitHub
parent d90652c342
commit befbd5b758
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,5 +1,5 @@
#!/usr/bin/with-contenv bash #!/usr/bin/with-contenv bash
scriptVersion="1.0.1" scriptVersion="1.0.2"
######## Settings ######## Settings
videoLanguages="eng" videoLanguages="eng"
@ -20,16 +20,17 @@ InstallRequirements () {
echo "************ setup directory ************" echo "************ setup directory ************"
mkdir -p /config/scripts/sma mkdir -p /config/scripts/sma
echo "************ download repo ************" echo "************ download repo ************"
git clone https://github.com/mdhiggins/sickbeard_mp4_automator.git /usr/local/sma git clone https://github.com/mdhiggins/sickbeard_mp4_automator.git /config/scripts/sma
mkdir -p /config/scripts/sma/config && \ mkdir -p /config/scripts/sma/config
echo "************ create logging file ************" echo "************ create logging file ************"
mkdir -p /config/scripts/sma/config && \ mkdir -p /config/scripts/sma/config
touch /config/scripts/sma/config/sma.log && \ touch /config/scripts/sma/config/sma.log
chgrp users /config/scripts/sma/config/sma.log && \ chgrp users /config/scripts/sma/config/sma.log
chmod g+w /config/scripts/sma/config/sma.log && \ chmod g+w /config/scripts/sma/config/sma.log
echo "************ install pip dependencies ************" && \ echo "************ install pip dependencies ************"
python3 -m pip install --upgrade pip && \ pip install --upgrade pip --no-cache-dir
pip3 install -r /config/scripts/sma/setup/requirements.txt pip install -r /config/scripts/sma/setup/requirements.txt --no-cache-dir
chmod 777 -R /config/scripts/sma
fi fi
} }
@ -164,14 +165,14 @@ VideoSmaProcess (){
extension="${fileName##*.}" extension="${fileName##*.}"
log "$count of $fileCount :: Processing $fileName" log "$count of $fileCount :: Processing $fileName"
if [ -f "$file" ]; then if [ -f "$file" ]; then
if [ -f /usr/local/sma/config/sma.log ]; then if [ -f /config/scripts/sma/config/sma.log ]; then
rm /usr/local/sma/config/sma.log rm /config/scripts/sma/config/sma.log
fi fi
log "$count of $fileCount :: Processing with SMA..." log "$count of $fileCount :: Processing with SMA..."
if [ -f "/config/scripts/sma.ini" ]; then if [ -f "/config/scripts/sma.ini" ]; then
# Manual run of Sickbeard MP4 Automator # Manual run of Sickbeard MP4 Automator
if python3 /usr/local/sma/manual.py --config "/config/scripts/sma.ini" -i "$file" $tagging; then if python3 /config/scripts/sma/manual.py --config "/config/scripts/sma.ini" -i "$file" $tagging; then
log "$count of $fileCount :: Complete!" log "$count of $fileCount :: Complete!"
else else
log "$count of $fileCount :: ERROR :: SMA Processing Error" log "$count of $fileCount :: ERROR :: SMA Processing Error"