Skip to content

Commit

Permalink
- Fixing crashing bug when using !uptime command and $streamuptime Sp…
Browse files Browse the repository at this point in the history
…ecial Identifiers
  • Loading branch information
SaviorXTanren committed Sep 30, 2023
1 parent 0a4589a commit 113f5ff
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions MixItUp.Base/Model/Commands/PreMadeChatCommandModels.cs
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,15 @@ public class UptimePreMadeChatCommandModel : PreMadeChatCommandModelBase
public static async Task<DateTimeOffset> GetStartTime(StreamingPlatformTypeEnum platform)
{
if (StreamingPlatforms.IsValidPlatform(platform))
{
IStreamingPlatformSessionService platformService = StreamingPlatforms.GetPlatformSessionService(platform);
if (platformService.IsConnected)
{
await platformService.RefreshChannel();
return platformService.StreamStart;
}
}
else
{
foreach (StreamingPlatformTypeEnum p in StreamingPlatforms.GetConnectedPlatforms())
{
Expand All @@ -234,15 +243,6 @@ public static async Task<DateTimeOffset> GetStartTime(StreamingPlatformTypeEnum
}
}
}
else
{
IStreamingPlatformSessionService platformService = StreamingPlatforms.GetPlatformSessionService(platform);
if (platformService.IsConnected)
{
await platformService.RefreshChannel();
return platformService.StreamStart;
}
}

return DateTimeOffset.MinValue;
}
Expand Down

0 comments on commit 113f5ff

Please sign in to comment.