use aggregate mapped data

to reduce the size of the API responses
This commit is contained in:
Ben Phelps
2022-09-17 13:05:44 +03:00
parent 9a77115a30
commit 28b2f79e5b
5 changed files with 57 additions and 17 deletions

View File

@@ -29,13 +29,11 @@ export default function Lidarr({ service }) {
);
}
const have = albumsData.filter((album) => album.statistics.percentOfTracks === 100);
return (
<Widget>
<Block label={t("lidarr.wanted")} value={t("common.number", { value: wantedData.totalRecords })} />
<Block label={t("lidarr.queued")} value={t("common.number", { value: queueData.totalCount })} />
<Block label={t("lidarr.albums")} value={t("common.number", { value: have.length })} />
<Block label={t("lidarr.albums")} value={t("common.number", { value: albumsData.have })} />
</Widget>
);
}