From ede381a91e6dc49f548ac0863a64756c6154497c Mon Sep 17 00:00:00 2001 From: Stevan Freeborn <65925598+StevanFreeborn@users.noreply.github.com> Date: Thu, 1 Jan 2026 22:14:44 -0600 Subject: [PATCH] feat: total all viewers for all live broadcasts --- index.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/index.cs b/index.cs index e33243a..32785b7 100644 --- a/index.cs +++ b/index.cs @@ -45,7 +45,14 @@ static async Task GetLiveViewerCountAsync(TokenResponse tokenResponse) return -1; } - return ytResponse.Items[0].Stats.Viewers; + var total = 0; + + foreach (var item in ytResponse.Items) + { + total += item.Stats.Viewers; + } + + return total; } static async Task GetTokenResponseAsync(Settings settings) @@ -271,4 +278,4 @@ internal sealed partial class JsonContext : JsonSerializerContext { } -#endregion \ No newline at end of file +#endregion