Skip to content

Commit 6e3a093

Browse files
authored
Merge pull request #227 from GiamBoscaro/main
feat: added Overseerr Requests Stats widget
2 parents 62fb355 + e9f2eb2 commit 6e3a093

File tree

5 files changed

+155
-0
lines changed

5 files changed

+155
-0
lines changed
Lines changed: 152 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,152 @@
1+
# Overseerr Requests Stats
2+
3+
* [Introduction](#introduction)
4+
* [Preview](#preview)
5+
* [Configuration](#configuration)
6+
* [Environment Variables](#environment-variables)
7+
* [Customization](#customization)
8+
* [Widget YAML](#widget-yaml)
9+
* [Gallery](#gallery)
10+
11+
## Introduction
12+
13+
Shows the total requests made in Overseerr, divided by media types (movies and TV series) and by their current status (pending, approved, declined, processing and available).
14+
15+
## Preview
16+
17+
![Full size widget](preview.png "Full size widget")
18+
19+
## Configuration
20+
21+
### Environment Variables
22+
23+
* `OVERSEERR_API_URL`: the URL of the Overseerr instance. Include `http://` or `https://`.
24+
* `OVERSEERR_API_KEY`: the API key of the server which can be found in _Settings > General > API key_
25+
26+
### Customization
27+
28+
Customize the widget appearance by editing these options:
29+
30+
| Name | Type | Required | Default | Description |
31+
| ------------ | ------- | -------- | ------- |------------ |
32+
| small-column | boolean | no | false | Set to true if used in a small column |
33+
| compact | boolean | no | false | Set to true to make the widget more compact and the font size smaller |
34+
35+
## Widget YAML
36+
37+
```yaml
38+
- type: custom-api
39+
title: Overseerr Requests
40+
title-url: ${OVERSEERR_API_URL}/requests
41+
url: ${OVERSEERR_API_URL}/api/v1/request/count
42+
cache: 1h
43+
options:
44+
small-column: true
45+
compact: false
46+
headers:
47+
accept: "application/json"
48+
x-api-key: ${OVERSEERR_API_KEY}
49+
template: |
50+
{{ $isSmallColumn := .Options.BoolOr "small-column" false }}
51+
{{ $isCompact := .Options.BoolOr "compact" false }}
52+
53+
{{ if eq .Response.StatusCode 200 }}
54+
{{ if $isSmallColumn }}
55+
<ul class="list list-gap-10 collapsible-container" data-collapse-after="3">
56+
<li class="flex items-start gap-10">
57+
<div class="flex-1 size-h3 {{ if $isCompact }}size-h5{{ end }}">Total</div>
58+
<div class="flex-1 color-highlight shrink-0 text-right size-h3 {{ if $isCompact }}size-h5{{ end }}">
59+
{{ .JSON.Int "total" | formatNumber }}
60+
</div>
61+
</li>
62+
<li class="flex items-start gap-10">
63+
<div class="flex-1 size-h3 {{ if $isCompact }}size-h5{{ end }}">Movies</div>
64+
<div class="flex-1 color-highlight shrink-0 text-right size-h3 {{ if $isCompact }}size-h5{{ end }}">
65+
{{ .JSON.Int "movie" | formatNumber }}
66+
</div>
67+
</li>
68+
<li class="flex items-start gap-10">
69+
<div class="flex-1 size-h3 {{ if $isCompact }}size-h5{{ end }}">TV Series</div>
70+
<div class="flex-1 color-highlight shrink-0 text-right size-h3 {{ if $isCompact }}size-h5{{ end }}">
71+
{{ .JSON.Int "tv" | formatNumber }}
72+
</div>
73+
</li>
74+
<li class="flex items-start gap-10">
75+
<div class="flex-1 size-h3 {{ if $isCompact }}size-h5{{ end }}">Pending</div>
76+
<div class="flex-1 color-highlight shrink-0 text-right size-h3 {{ if $isCompact }}size-h5{{ end }}">
77+
{{ .JSON.Int "pending" | formatNumber }}
78+
</div>
79+
</li>
80+
<li class="flex items-start gap-10">
81+
<div class="flex-1 size-h3 {{ if $isCompact }}size-h5{{ end }}">Approved</div>
82+
<div class="flex-1 color-highlight shrink-0 text-right size-h3 {{ if $isCompact }}size-h5{{ end }}">
83+
{{ .JSON.Int "approved" | formatNumber }}
84+
</div>
85+
</li>
86+
<li class="flex items-start gap-10">
87+
<div class="flex-1 size-h3 {{ if $isCompact }}size-h5{{ end }}">Declined</div>
88+
<div class="flex-1 color-highlight shrink-0 text-right size-h3 {{ if $isCompact }}size-h5{{ end }}">
89+
{{ .JSON.Int "declined" | formatNumber }}
90+
</div>
91+
</li>
92+
<li class="flex items-start gap-10">
93+
<div class="flex-1 size-h3 {{ if $isCompact }}size-h5{{ end }}">Processing</div>
94+
<div class="flex-1 color-highlight shrink-0 text-right size-h3 {{ if $isCompact }}size-h5{{ end }}">
95+
{{ .JSON.Int "processing" | formatNumber }}
96+
</div>
97+
</li>
98+
<li class="flex items-start gap-10">
99+
<div class="flex-1 size-h3 {{ if $isCompact }}size-h5{{ end }}">Available</div>
100+
<div class="flex-1 color-highlight shrink-0 text-right size-h3 {{ if $isCompact }}size-h5{{ end }}">
101+
{{ .JSON.Int "available" | formatNumber }}
102+
</div>
103+
</li>
104+
</ul>
105+
{{ else }}
106+
<div class="flex justify-evenly text-center">
107+
<div>
108+
<div class="color-highlight size-h1 {{ if $isCompact }}size-h3{{ end }}">{{ .JSON.Int "total" | formatNumber }}</div>
109+
<div class="size-h3 {{ if $isCompact }}size-h5{{ end }}">Total</div>
110+
</div>
111+
<div>
112+
<div class="color-highlight size-h1 {{ if $isCompact }}size-h3{{ end }}">{{ .JSON.Int "movie" | formatNumber }}</div>
113+
<div class="size-h3 {{ if $isCompact }}size-h5{{ end }}">Movies</div>
114+
</div>
115+
<div>
116+
<div class="color-highlight size-h1 {{ if $isCompact }}size-h3{{ end }}">{{ .JSON.Int "tv" | formatNumber }}</div>
117+
<div class="size-h3 {{ if $isCompact }}size-h5{{ end }}">TV Series</div>
118+
</div>
119+
{{ if not $isCompact }}
120+
</div>
121+
<div class="flex justify-evenly text-center margin-top-20">
122+
{{ end }}
123+
<div>
124+
<div class="color-highlight size-h1 {{ if $isCompact }}size-h3{{ end }}">{{ .JSON.Int "pending" | formatNumber }}</div>
125+
<div class="size-h3 {{ if $isCompact }}size-h5{{ end }}">Pending</div>
126+
</div>
127+
<div>
128+
<div class="color-highlight size-h1 {{ if $isCompact }}size-h3{{ end }}">{{ .JSON.Int "approved" | formatNumber }}</div>
129+
<div class="size-h3 {{ if $isCompact }}size-h5{{ end }}">Approved</div>
130+
</div>
131+
<div>
132+
<div class="color-highlight size-h1 {{ if $isCompact }}size-h3{{ end }}">{{ .JSON.Int "declined" | formatNumber }}</div>
133+
<div class="size-h3 {{ if $isCompact }}size-h5{{ end }}">Declined</div>
134+
</div>
135+
<div>
136+
<div class="color-highlight size-h1 {{ if $isCompact }}size-h3{{ end }}">{{ .JSON.Int "processing" | formatNumber }}</div>
137+
<div class="size-h3 {{ if $isCompact }}size-h5{{ end }}">Processing</div>
138+
</div>
139+
<div>
140+
<div class="color-highlight size-h1 {{ if $isCompact }}size-h3{{ end }}">{{ .JSON.Int "available" | formatNumber }}</div>
141+
<div class="size-h3 {{ if $isCompact }}size-h5{{ end }}">Available</div>
142+
</div>
143+
</div>
144+
{{ end }}
145+
{{ end }}
146+
```
147+
148+
## Gallery
149+
150+
![Compact full size](preview-full-compact.png "Full size column, compact mode")
151+
152+
![Small collapsed](preview-small-collapsed.png "Small size column, collapsed widget")
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
title: Overseerr Requests Stats
2+
description: Shows the requests count grouped by media types and status
3+
author: GiamBoscaro
40.9 KB
Loading
32.1 KB
Loading
51.9 KB
Loading

0 commit comments

Comments
 (0)