From a8c03a2380b61b9c1791af31fe8dd7898206fac0 Mon Sep 17 00:00:00 2001 From: RandomNinjaAtk Date: Wed, 9 Nov 2022 18:11:00 -0500 Subject: [PATCH] 1.0.2 - Add Extras.bash process, re-organize script --- root/scripts/SMA.bash | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/root/scripts/SMA.bash b/root/scripts/SMA.bash index fd08baa..9c6e4e1 100644 --- a/root/scripts/SMA.bash +++ b/root/scripts/SMA.bash @@ -1,5 +1,5 @@ #!/usr/bin/env bash -scriptVersion="1.0.1" +scriptVersion="1.0.2" arrEventType="$sonarr_eventtype" # auto-clean up log file to reduce space usage @@ -21,6 +21,11 @@ if [ "$arrEventType" == "Test" ]; then exit fi +Extras () { + # Extras Script + bash /config/extended/scripts/Extras.bash "$sonarr_series_id" +} + NotifyPlex () { # Process item with PlexNotify.bash if plexToken is configured if [ ! -z "$plexToken" ]; then @@ -30,15 +35,19 @@ NotifyPlex () { fi } -log "Processing :: $sonarr_episodefile_path" -if python3 /usr/local/sma/manual.py --config "/config/extended/configs/sma.ini" -i "$sonarr_episodefile_path" -tvdb $sonarr_series_tvdbid -s $sonarr_episodefile_seasonnumber -e $sonarr_episodefile_episodenumbers -a; then - sleep 0.01 - log "COMPLETE!" - rm /usr/local/sma/config/*log* -else - log "ERROR :: SMA Processing Error" -fi +ProcessWithSma () { + log "Processing :: $sonarr_episodefile_path" + if python3 /usr/local/sma/manual.py --config "/config/extended/configs/sma.ini" -i "$sonarr_episodefile_path" -tvdb $sonarr_series_tvdbid -s $sonarr_episodefile_seasonnumber -e $sonarr_episodefile_episodenumbers -a; then + sleep 0.01 + log "COMPLETE!" + rm /usr/local/sma/config/*log* + else + log "ERROR :: SMA Processing Error" + fi +} +ProcessWithSma +Extras NotifyPlex exit