# *arr community widget: Sonarr recent episodes - type: custom-api title: Recent Episodes title-url: ${SONARR_URL} cache: 30m options: service: sonarr type: recent size: medium collapse-after: 5 show-grabbed: false interval: 20 api-base-url: ${SONARR_API_URL} key: ${SONARR_KEY} url: ${SONARR_URL} template: | {{ $collapseAfter := .Options.IntOr "collapse-after" 5 }} {{ $showGrabbed := .Options.BoolOr "show-grabbed" false }} {{ $sortTime := .Options.StringOr "sort-time" "desc" }} {{ $coverProxy := .Options.StringOr "cover-proxy" "" }} {{ $size := .Options.StringOr "size" "medium" }} {{ $service := .Options.StringOr "service" "" }} {{ $type := .Options.StringOr "type" "" }} {{ $intervalH := .Options.IntOr "interval" 0 | mul 24 }} {{ $now := now | formatTime "2006-01-02T15:04:05" }} {{ $posInterval := (offsetNow (printf "+%dh" $intervalH)) | formatTime "2006-01-02T15:04:05" }} {{ $negInterval := (offsetNow (printf "-%dh" $intervalH)) | formatTime "2006-01-02T15:04:05" }} {{ $apiBaseUrl := .Options.StringOr "api-base-url" "" }} {{ $key := .Options.StringOr "key" "" }} {{ $url := .Options.StringOr "url" $apiBaseUrl }} {{ if or (and (ne $service "sonarr") (ne $service "radarr") (ne $service "lidarr")) (and (ne $type "upcoming") (ne $type "recent") (ne $type "missing")) (eq $apiBaseUrl "") (eq $key "") (eq $url "") }}
Some options are not set or malformed
| service | {{ $service }} | must be sonarr, radarr, or lidarr |
| type | {{ $type }} | must be upcoming, recent, or missing |
| api-base-url | {{ $apiBaseUrl }} | should include http(s):// and port if needed |
| key | {{ $key }} |
{{ if ne $popoverSummary "" }} {{ $popoverSummary }} {{ else }} TBA {{ end }}
{{ if gt (len ($genres.Array "")) 0 }} {{ end }}