diff --git a/kubernetes/main/apps/default/sonarr/app/resources/refresh-series.sh b/kubernetes/main/apps/default/sonarr/app/resources/refresh-series.sh index ec7658a235c87..f88c7233b1ec8 100755 --- a/kubernetes/main/apps/default/sonarr/app/resources/refresh-series.sh +++ b/kubernetes/main/apps/default/sonarr/app/resources/refresh-series.sh @@ -5,7 +5,7 @@ if [[ "${sonarr_eventtype:-}" == "Grab" ]]; then tba_count=$(curl -fsSL \ --header "X-Api-Key: ${SONARR__AUTH__APIKEY}" \ "http://localhost:${SONARR__SERVER__PORT}/api/v3/episode?seriesId=${sonarr_series_id}" \ - | jq --raw-output '.[] | select((.title == "TBA") or (.title == "TBD"))' | jq --slurp 'length') + | jq --raw-output '[.[] | select((.title == "TBA") or (.title == "TBD"))] | length') if (( tba_count > 0 )); then echo "INFO: Refreshing series ${sonarr_series_id} due to TBA/TBD episodes found"