From 667a0a8719547cd47a0be72c52aa9cf4ec68dcae Mon Sep 17 00:00:00 2001 From: MaximilianKos Date: Sat, 18 May 2024 23:09:49 +0200 Subject: [PATCH] added private and public video counts --- docs/widgets/services/fireshare.md | 2 +- public/locales/en/common.json | 4 +++- src/widgets/fireshare/component.jsx | 6 ++++++ 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/docs/widgets/services/fireshare.md b/docs/widgets/services/fireshare.md index ab26e403..6e4826d4 100644 --- a/docs/widgets/services/fireshare.md +++ b/docs/widgets/services/fireshare.md @@ -5,7 +5,7 @@ description: Fireshare Widget Configuration Learn more about [Fireshare](https://github.com/ShaneIsrael/fireshare). -Allowed fields: `["total", "categories", "views"]`. +Allowed fields: `["total", "categories", "views", "private", "public"]`. ```yaml widget: diff --git a/public/locales/en/common.json b/public/locales/en/common.json index f4ccde6a..490e7f35 100644 --- a/public/locales/en/common.json +++ b/public/locales/en/common.json @@ -886,6 +886,8 @@ "fireshare": { "total": "Total", "categories": "Categories", - "views": "Views" + "views": "Views", + "private": "Private", + "public": "Public" } } diff --git a/src/widgets/fireshare/component.jsx b/src/widgets/fireshare/component.jsx index 353f72d1..cee64ad5 100644 --- a/src/widgets/fireshare/component.jsx +++ b/src/widgets/fireshare/component.jsx @@ -21,6 +21,8 @@ export default function Component({ service }) { + + ); } @@ -33,12 +35,16 @@ export default function Component({ service }) { }); const categoriesCount = categoriesSet.size; 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 ( + + ); }