{{ $url := .Options.StringOr "url" "" }} {{ $key := .Options.StringOr "key" "" }} {{- if or (eq $url "") (eq $key "") -}}

Error: The URL or API Key was not configured in the widget options.

{{- else -}} {{- $requestUrl := printf "%s/emby/Items/Counts?api_key=%s" $url $key -}} {{- $jellyfinData := newRequest $requestUrl | getResponse -}} {{- if eq $jellyfinData.Response.StatusCode 200 -}}
{{ $jellyfinData.JSON.Int "MovieCount" | formatNumber }}
Movies
{{ $jellyfinData.JSON.Int "SeriesCount" | formatNumber }}
TV Shows
{{ $jellyfinData.JSON.Int "EpisodeCount" | formatNumber }}
Episodes
{{ $jellyfinData.JSON.Int "SongCount" | formatNumber }}
Songs
{{- else -}}

Failed: {{ $jellyfinData.Response.Status }}

{{- end -}} {{- end -}}