From a7b7da5fa37ff0cda027f7a0587e3cd0be33e9f1 Mon Sep 17 00:00:00 2001 From: Matthew Olivo Date: Thu, 25 Jan 2024 20:40:02 -0800 Subject: [PATCH] - Adding extra checks around Twitch Upcoming Ad trigger --- MixItUp.Base/Services/Twitch/TwitchSessionService.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MixItUp.Base/Services/Twitch/TwitchSessionService.cs b/MixItUp.Base/Services/Twitch/TwitchSessionService.cs index 981e30e56..a6624188b 100644 --- a/MixItUp.Base/Services/Twitch/TwitchSessionService.cs +++ b/MixItUp.Base/Services/Twitch/TwitchSessionService.cs @@ -389,11 +389,11 @@ public async Task RefreshChannel() if (this.AdSchedule != null) { - DateTimeOffset nextAd = adSchedule.NextAdTimestamp(); + DateTimeOffset nextAd = this.AdSchedule.NextAdTimestamp(); if (nextAd > this.NextAdTimestamp) { int nextAdMinutes = this.AdSchedule.NextAdMinutesFromNow(); - if (nextAdMinutes <= ChannelSession.Settings.TwitchUpcomingAdCommandTriggerAmount) + if (nextAdMinutes <= ChannelSession.Settings.TwitchUpcomingAdCommandTriggerAmount && nextAdMinutes > 0) { this.NextAdTimestamp = nextAd;