added private and public video counts
This commit is contained in:
parent
f57368519f
commit
667a0a8719
@ -5,7 +5,7 @@ description: Fireshare Widget Configuration
|
|||||||
|
|
||||||
Learn more about [Fireshare](https://github.com/ShaneIsrael/fireshare).
|
Learn more about [Fireshare](https://github.com/ShaneIsrael/fireshare).
|
||||||
|
|
||||||
Allowed fields: `["total", "categories", "views"]`.
|
Allowed fields: `["total", "categories", "views", "private", "public"]`.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
widget:
|
widget:
|
||||||
|
|||||||
@ -886,6 +886,8 @@
|
|||||||
"fireshare": {
|
"fireshare": {
|
||||||
"total": "Total",
|
"total": "Total",
|
||||||
"categories": "Categories",
|
"categories": "Categories",
|
||||||
"views": "Views"
|
"views": "Views",
|
||||||
|
"private": "Private",
|
||||||
|
"public": "Public"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,6 +21,8 @@ export default function Component({ service }) {
|
|||||||
<Block label="fireshare.total" />
|
<Block label="fireshare.total" />
|
||||||
<Block label="fireshare.categories" />
|
<Block label="fireshare.categories" />
|
||||||
<Block label="fireshare.views" />
|
<Block label="fireshare.views" />
|
||||||
|
<Block label="fireshare.private" />
|
||||||
|
<Block label="fireshare.public" />
|
||||||
</Container>
|
</Container>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -33,12 +35,16 @@ export default function Component({ service }) {
|
|||||||
});
|
});
|
||||||
const categoriesCount = categoriesSet.size;
|
const categoriesCount = categoriesSet.size;
|
||||||
const totalViews = infoData.videos.reduce((acc, video) => acc + video.view_count, 0);
|
const totalViews = infoData.videos.reduce((acc, video) => acc + video.view_count, 0);
|
||||||
|
const privateCount = infoData.videos.filter(video => video.info.private).length;
|
||||||
|
const publicCount = total - privateCount;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Container service={service}>
|
<Container service={service}>
|
||||||
<Block label="fireshare.total" value={total} />
|
<Block label="fireshare.total" value={total} />
|
||||||
<Block label="fireshare.categories" value={categoriesCount} />
|
<Block label="fireshare.categories" value={categoriesCount} />
|
||||||
<Block label="fireshare.views" value={totalViews} />
|
<Block label="fireshare.views" value={totalViews} />
|
||||||
|
<Block label="fireshare.private" value={privateCount} />
|
||||||
|
<Block label="fireshare.public" value={publicCount} />
|
||||||
</Container>
|
</Container>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user