diff --git a/config/statistics.yml b/config/statistics.yml index edf417b..22d3653 100644 --- a/config/statistics.yml +++ b/config/statistics.yml @@ -15,10 +15,10 @@ {{- 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 -}} - {{- $audiobooksUrl := printf "%s/emby/Items?IncludeItemTypes=AudioBook&Recursive=true&Limit=0&EnableTotalRecordCount=true&api_key=%s" $url $key -}} - {{- $audiobooksData := newRequest $audiobooksUrl | getResponse -}} + {{- $countsUrl := printf "%s/emby/Items/Counts" $url -}} + {{- $jellyfinData := newRequest $countsUrl | withHeader "X-Api-Key" $key | getResponse -}} + {{- $audiobooksUrl := printf "%s/emby/Items?IncludeItemTypes=AudioBook&Recursive=true&Limit=0&EnableTotalRecordCount=true" $url -}} + {{- $audiobooksData := newRequest $audiobooksUrl | withHeader "X-Api-Key" $key | getResponse -}} {{- if and (eq $jellyfinData.Response.StatusCode 200) (eq $audiobooksData.Response.StatusCode 200) -}}