From 8fba3eee1df1fad15377d44aae542a018b50b321 Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Sat, 3 Aug 2024 16:49:06 -0700 Subject: [PATCH] Enhancement: use tubearchivist stats endpoints (#3814) --- docs/widgets/services/tubearchivist.md | 4 ++-- src/widgets/tubearchivist/component.jsx | 14 ++++---------- src/widgets/tubearchivist/widget.js | 19 +++++++++++-------- 3 files changed, 17 insertions(+), 20 deletions(-) diff --git a/docs/widgets/services/tubearchivist.md b/docs/widgets/services/tubearchivist.md index 30256d92b..3b66a3cb3 100644 --- a/docs/widgets/services/tubearchivist.md +++ b/docs/widgets/services/tubearchivist.md @@ -5,7 +5,7 @@ description: Tube Archivist Widget Configuration Learn more about [Tube Archivist](https://github.com/tubearchivist/tubearchivist). -Requires API key. +You must be running at least version 0.4.4 Allowed fields: `["downloads", "videos", "channels", "playlists"]`. @@ -13,5 +13,5 @@ Allowed fields: `["downloads", "videos", "channels", "playlists"]`. widget: type: tubearchivist url: http://tubearchivist.host.or.ip - key: apikeyapikeyapikeyapikeyapikey + key: tubearchivistapikey ``` diff --git a/src/widgets/tubearchivist/component.jsx b/src/widgets/tubearchivist/component.jsx index c29ae1c45..c95db074e 100644 --- a/src/widgets/tubearchivist/component.jsx +++ b/src/widgets/tubearchivist/component.jsx @@ -32,16 +32,10 @@ export default function Component({ service }) { return ( - - - - + + + + ); } diff --git a/src/widgets/tubearchivist/widget.js b/src/widgets/tubearchivist/widget.js index addd47c50..979e1b02e 100644 --- a/src/widgets/tubearchivist/widget.js +++ b/src/widgets/tubearchivist/widget.js @@ -6,20 +6,23 @@ const widget = { mappings: { downloads: { - endpoint: "download", - validate: ["paginate"], + endpoint: "stats/download", + validate: ["pending"], }, videos: { - endpoint: "video", - validate: ["paginate"], + endpoint: "stats/video", + validate: ["doc_count"], }, channels: { - endpoint: "channel", - validate: ["paginate"], + endpoint: "stats/channel", + validate: ["doc_count"], }, playlists: { - endpoint: "playlist", - validate: ["paginate"], + endpoint: "stats/playlist", + validate: ["doc_count"], + }, + stats: { + endpoint: "stats", }, }, };