Widen Sonarr reverse-kids-leak to non-US adult certification scales

This commit is contained in:
Gmer4Lfe
2026-07-17 11:53:39 -04:00
parent de57f87b82
commit 10d6f372b3
+5 -1
View File
@@ -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))
}
)
')