feat: total all viewers for all live broadcasts
This commit is contained in:
@@ -45,7 +45,14 @@ static async Task<int> 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<TokenResponse> GetTokenResponseAsync(Settings settings)
|
||||
@@ -271,4 +278,4 @@ internal sealed partial class JsonContext : JsonSerializerContext
|
||||
{
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
Reference in New Issue
Block a user