Enhancement: use tubearchivist stats endpoints
This commit is contained in:
parent
ed928bfa25
commit
aa1d96a259
@ -32,16 +32,10 @@ export default function Component({ service }) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<Container service={service}>
|
<Container service={service}>
|
||||||
<Block
|
<Block label="tubearchivist.downloads" value={t("common.number", { value: downloadsData.doc_count ?? 0 })} />
|
||||||
label="tubearchivist.downloads"
|
<Block label="tubearchivist.videos" value={t("common.number", { value: videosData.doc_count ?? 0 })} />
|
||||||
value={t("common.number", { value: downloadsData?.paginate?.total_hits })}
|
<Block label="tubearchivist.channels" value={t("common.number", { value: channelsData.doc_count ?? 0 })} />
|
||||||
/>
|
<Block label="tubearchivist.playlists" value={t("common.number", { value: playlistsData.doc_count ?? 0 })} />
|
||||||
<Block label="tubearchivist.videos" value={t("common.number", { value: videosData?.paginate?.total_hits })} />
|
|
||||||
<Block label="tubearchivist.channels" value={t("common.number", { value: channelsData?.paginate?.total_hits })} />
|
|
||||||
<Block
|
|
||||||
label="tubearchivist.playlists"
|
|
||||||
value={t("common.number", { value: playlistsData?.paginate?.total_hits })}
|
|
||||||
/>
|
|
||||||
</Container>
|
</Container>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,20 +6,23 @@ const widget = {
|
|||||||
|
|
||||||
mappings: {
|
mappings: {
|
||||||
downloads: {
|
downloads: {
|
||||||
endpoint: "download",
|
endpoint: "stats/download",
|
||||||
validate: ["paginate"],
|
validate: ["doc_count"],
|
||||||
},
|
},
|
||||||
videos: {
|
videos: {
|
||||||
endpoint: "video",
|
endpoint: "stats/video",
|
||||||
validate: ["paginate"],
|
validate: ["doc_count"],
|
||||||
},
|
},
|
||||||
channels: {
|
channels: {
|
||||||
endpoint: "channel",
|
endpoint: "stats/channel",
|
||||||
validate: ["paginate"],
|
validate: ["doc_count"],
|
||||||
},
|
},
|
||||||
playlists: {
|
playlists: {
|
||||||
endpoint: "playlist",
|
endpoint: "stats/playlist",
|
||||||
validate: ["paginate"],
|
validate: ["doc_count"],
|
||||||
|
},
|
||||||
|
stats: {
|
||||||
|
endpoint: "stats",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user