diff --git a/Lidarr-MusicAutomator.bash b/Lidarr-MusicAutomator.bash index 61737ce..4a92c0e 100644 --- a/Lidarr-MusicAutomator.bash +++ b/Lidarr-MusicAutomator.bash @@ -25,7 +25,9 @@ verifyConfig () { } InstallDependencies () { - if apk --no-cache list | grep installed | grep python3 | read; then + # Fix: Check for py3-pip specifically. Checking only for python3 can lead to a state where + # python is installed but pip is missing, causing the subsequent 'python3 -m pip' commands to fail. + if apk --no-cache list | grep installed | grep py3-pip | read; then log "Dependencies already installed, skipping..." else log "Installing script dependencies...." diff --git a/Queue-Cleaner.bash b/Queue-Cleaner.bash index fad293e..8f63cdc 100644 --- a/Queue-Cleaner.bash +++ b/Queue-Cleaner.bash @@ -82,8 +82,9 @@ QueueCleanerProcess () { fi arrQueueIdCount=$(echo "$arrQueueData" | jq -r ".id" | wc -l) - arrQueueCompletedIds=$(echo "$arrQueueData" | jq -r 'select(.status=="completed") | select(.trackedDownloadStatus=="warning") | .id') - arrQueueIdsCompletedCount=$(echo "$arrQueueData" | jq -r 'select(.status=="completed") | select(.trackedDownloadStatus=="warning") | .id' | wc -l) + # Exclude TBA items from the "Completed/Warning" cleanup list + arrQueueCompletedIds=$(echo "$arrQueueData" | jq -r 'select(.status=="completed") | select(.trackedDownloadStatus=="warning") | select(.statusMessages | tostring | contains("TBA") | not) | .id') + arrQueueIdsCompletedCount=$(echo "$arrQueueCompletedIds" | wc -w) arrQueueFailedIds=$(echo "$arrQueueData" | jq -r 'select(.status=="failed") | .id') arrQueueIdsFailedCount=$(echo "$arrQueueData" | jq -r 'select(.status=="failed") | .id' | wc -l) arrQueueStalledIds=$(echo "$arrQueueData" | jq -r 'select(.status=="stalled") | .id')