You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
homepage/src/widgets/sonarr/widget.js

31 lines
587 B

import genericProxyHandler from "utils/proxy/handlers/generic";
import { asJson } from "utils/proxy/api-helpers";
const widget = {
api: "{url}/api/v3/{endpoint}?apikey={key}",
proxyHandler: genericProxyHandler,
mappings: {
series: {
endpoint: "series",
map: (data) => ({
total: asJson(data).length,
})
},
queue: {
endpoint: "queue",
validate: [
"totalRecords"
]
},
"wanted/missing": {
endpoint: "wanted/missing",
validate: [
"totalRecords"
]
},
},
};
export default widget;