mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-18 18:49:50 +00:00
24 lines
574 B
JavaScript
24 lines
574 B
JavaScript
import genericProxyHandler from "utils/proxy/handlers/generic";
|
|
import { jsonArrayFilter } from "utils/proxy/api-helpers";
|
|
|
|
const widget = {
|
|
api: "{url}/api/v1/{endpoint}?apikey={key}",
|
|
proxyHandler: genericProxyHandler,
|
|
|
|
mappings: {
|
|
album: {
|
|
endpoint: "album",
|
|
map: (data) => ({
|
|
have: jsonArrayFilter(data, (item) => item?.statistics?.percentOfTracks === 100).length,
|
|
}),
|
|
},
|
|
"wanted/missing": {
|
|
endpoint: "wanted/missing",
|
|
},
|
|
"queue/status": {
|
|
endpoint: "queue/status",
|
|
},
|
|
},
|
|
};
|
|
|
|
export default widget;
|