Skip to content

Commit

Permalink
LiveBroadcastContentValidValues
Browse files Browse the repository at this point in the history
  • Loading branch information
granstel committed Feb 24, 2024
1 parent ef99255 commit befeb67
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Dodo1000Bot.Services/YoutubeService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ namespace Dodo1000Bot.Services;

public class YoutubeService: CheckAndNotifyService
{
private static readonly string[] LiveBroadcastContentValidValues = new[]
{
"none",
"live"
};

private readonly ILogger<YoutubeService> _log;
private readonly YoutubeConfiguration _configuration;
private readonly IYouTubeClient _youTubeClient;
Expand Down Expand Up @@ -46,6 +52,11 @@ public async Task CheckAndNotify(CancellationToken cancellationToken)

foreach (var video in difference)
{
if (!LiveBroadcastContentValidValues.Contains(video.Snippet.LiveBroadcastContent))
{
continue;
}

var notification = new Notification(NotificationType.Admin)
{
Payload = new NotificationPayload
Expand Down

0 comments on commit befeb67

Please sign in to comment.