mirror of
https://github.com/gethomepage/homepage.git
synced 2026-01-08 00:12:08 +08:00
Add Sonarr refactor
This commit is contained in:
24
src/widgets/sonarr/widget.js
Normal file
24
src/widgets/sonarr/widget.js
Normal file
@@ -0,0 +1,24 @@
|
||||
import genericProxyHandler from "utils/proxies/generic";
|
||||
import { asJson } from "utils/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",
|
||||
},
|
||||
"wanted/missing": {
|
||||
endpoint: "wanted/missing",
|
||||
},
|
||||
},
|
||||
};
|
||||
|
||||
export default widget;
|
||||
Reference in New Issue
Block a user