v1.5 - If non-daily series keep entire season worth of media
#105 This change ignores your custom episode count for series that are not considered daily and keeps the number of episodes that match the latest season episode count. Which is likely more desirable for TV series that want to have a rolling episode count, to ensure you can pickup watching the series at any given time during the latest season and miss anything...
This commit is contained in:
parent
7f694337f9
commit
6277da3971
1 changed files with 8 additions and 3 deletions
|
@ -1,5 +1,5 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
scriptVersion="1.4"
|
scriptVersion="1.5"
|
||||||
scriptName="SeriesEpisodeTrimmer"
|
scriptName="SeriesEpisodeTrimmer"
|
||||||
|
|
||||||
#### Import Settings
|
#### Import Settings
|
||||||
|
@ -45,14 +45,19 @@ else
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Verify series is marked as "daily" type by sonarr, skip if not...
|
# Verify series is marked as "daily" type by sonarr, skip if not...
|
||||||
if [ $seriesType != "daily" ] && [ "$tagMatch" == "false" ]; then
|
if [ $seriesType != "daily" ] && [ "$tagMatch" == "false" ]; then
|
||||||
log "$seriesTitle (ID:$seriesId) :: ERROR :: Series does not match TYPE: Daily or TAG: $sonarrSeriesEpisodeTrimmerTag, skipping..."
|
log "$seriesTitle (ID:$seriesId) :: ERROR :: Series does not match TYPE: Daily or TAG: $sonarrSeriesEpisodeTrimmerTag, skipping..."
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# 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)
|
||||||
|
fi
|
||||||
|
|
||||||
# Skip processing if less than 14 episodes were found to be downloaded
|
# Skip processing if less than the maximumDailyEpisodes setting were found to be downloaded
|
||||||
if [ $seriesEpisodeIdsCount -lt $maximumDailyEpisodes ]; then
|
if [ $seriesEpisodeIdsCount -lt $maximumDailyEpisodes ]; then
|
||||||
log "$seriesTitle (ID:$seriesId) :: ERROR :: Series has not exceeded $maximumDailyEpisodes downloaded episodes ($seriesEpisodeIdsCount files found), skipping..."
|
log "$seriesTitle (ID:$seriesId) :: ERROR :: Series has not exceeded $maximumDailyEpisodes downloaded episodes ($seriesEpisodeIdsCount files found), skipping..."
|
||||||
exit
|
exit
|
||||||
|
|
Loading…
Reference in a new issue