Snap to Radarr's native filter logic

pull/418/head
Jason Fischer 2 years ago
parent 1286466669
commit f022315d11
No known key found for this signature in database

@ -100,6 +100,7 @@
},
"radarr": {
"wanted": "Wanted",
"missing": "Missing",
"queued": "Queued",
"movies": "Movies"
},

@ -20,6 +20,7 @@ export default function Component({ service }) {
return (
<Container service={service}>
<Block label="radarr.wanted" />
<Block label="radarr.missing" />
<Block label="radarr.queued" />
<Block label="radarr.movies" />
</Container>
@ -29,6 +30,7 @@ export default function Component({ service }) {
return (
<Container service={service}>
<Block label="radarr.wanted" value={moviesData.wanted} />
<Block label="radarr.missing" value={moviesData.missing} />
<Block label="radarr.queued" value={queuedData.totalCount} />
<Block label="radarr.movies" value={moviesData.all} />
</Container>

@ -10,7 +10,8 @@ const widget = {
endpoint: "movie",
map: (data) => ({
wanted: jsonArrayFilter(data, (item) => item.monitored && !item.hasFile && item.isAvailable).length,
all: jsonArrayFilter(data, (item) => item.isAvailable).length,
have: jsonArrayFilter(data, (item) => item.hasFile).length,
missing: jsonArrayFilter(data, (item) => item.monitored && !item.hasFile).length,
}),
},
"queue/status": {

Loading…
Cancel
Save