diff --git a/Arrs_Stack/sonarr_classification_scan.sh b/Arrs_Stack/sonarr_classification_scan.sh index 2bd3fab..a95acf8 100755 --- a/Arrs_Stack/sonarr_classification_scan.sh +++ b/Arrs_Stack/sonarr_classification_scan.sh @@ -163,10 +163,14 @@ echo "━━━ $ICON_CLEAN Classifying ━━━" ANIME_NETWORKS_JSON=$(printf '%s\n' "${SONARR_ANIME_NETWORKS[@]}" | jq -R . | jq -s .) KIDS_NETWORKS_JSON=$(printf '%s\n' "${SONARR_KIDS_NETWORKS[@]}" | jq -R . | jq -s .) +# Not just the US TV-MA/TV-14 tiers — non-US certification scales use different labels for the +# same "clearly adult" tier (confirmed live: "Tomb Raider: The Legend of Lara Croft" is "16+"). +ADULT_CERT_JSON='["TV-MA","TV-14","MA15+","16","16+","18","15","14"]' RESULTS=$(echo "$SERIES_RESPONSE" | jq \ --argjson animeNetworks "$ANIME_NETWORKS_JSON" \ --argjson kidsNetworks "$KIDS_NETWORKS_JSON" \ + --argjson adultCert "$ADULT_CERT_JSON" \ --arg animeRoot "${SONARR_ANIME_ROOT:-}" \ --arg kidsRoot "${SONARR_KIDS_ROOT:-}" ' def is_anime: @@ -192,7 +196,7 @@ RESULTS=$(echo "$SERIES_RESPONSE" | jq \ forward_kids_miss: (.is_kids and $kidsRoot != "" and .rootFolderPath != $kidsRoot), reverse_anime_leak: ((.is_anime | not) and $animeRoot != "" and .rootFolderPath == $animeRoot), reverse_kids_leak: ((.is_anime | not) and (.is_kids | not) and $kidsRoot != "" and .rootFolderPath == $kidsRoot - and (.certification == "TV-MA" or .certification == "TV-14")) + and (.certification as $c | $adultCert | index($c) != null)) } ) ')