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.
23 lines
564 B
23 lines
564 B
2 years ago
|
import genericProxyHandler from "utils/proxies/generic";
|
||
|
import { jsonArrayFilter } from "utils/api-helpers";
|
||
|
|
||
|
const widget = {
|
||
|
api: "{url}/api/v3/{endpoint}?apikey={key}",
|
||
|
proxyHandler: genericProxyHandler,
|
||
|
|
||
|
mappings: {
|
||
|
movie: {
|
||
|
endpoint: "movie",
|
||
|
map: (data) => ({
|
||
|
wanted: jsonArrayFilter(data, (item) => item.isAvailable === false).length,
|
||
|
have: jsonArrayFilter(data, (item) => item.isAvailable === true).length,
|
||
|
}),
|
||
|
},
|
||
|
"queue/status": {
|
||
|
endpoint: "queue/status",
|
||
|
},
|
||
|
},
|
||
|
};
|
||
|
|
||
|
export default widget;
|