From a50faa394dd8cef28bb1cc9e4a9dcbeec4719199 Mon Sep 17 00:00:00 2001 From: James Ashcraft Date: Wed, 28 Jan 2026 14:51:39 -0600 Subject: [PATCH] Fix: exclude specials and dummy seasons from episode count calculation --- Sonarr-DailySeriesEpisodeTrimmer.bash | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sonarr-DailySeriesEpisodeTrimmer.bash b/Sonarr-DailySeriesEpisodeTrimmer.bash index ab0ff69..a4255ff 100644 --- a/Sonarr-DailySeriesEpisodeTrimmer.bash +++ b/Sonarr-DailySeriesEpisodeTrimmer.bash @@ -87,7 +87,7 @@ DailySeriesTrimmerProcess () { # If non-daily series, set maximum episode count to match latest season total episode count if [ $seriesType != "daily" ]; then - maximumDailyEpisodes=$(echo "$seriesData" | jq -r ".seasons | sort_by(.seasonNumber) | reverse | .[].statistics.totalEpisodeCount" | head -n1) + maximumDailyEpisodes=$(echo "$seriesData" | jq -r ".seasons | map(select(.seasonNumber > 0 and .statistics.totalEpisodeCount > 1)) | sort_by(.seasonNumber) | reverse | .[].statistics.totalEpisodeCount" | head -n1) fi # Skip processing if less than the maximumDailyEpisodes setting were found to be downloaded