Skip to content

Commit

Permalink
Fix Local request oversight
Browse files Browse the repository at this point in the history
  • Loading branch information
Sekoree committed Mar 18, 2022
1 parent 61c2869 commit fdcd54d
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Audiosurf2_Tools/ViewModels/TwitchBotViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -179,10 +179,13 @@ private void Client_OnCommandReceived(object? sender, OnMessageReceivedArgs e)
public async Task LocalRequestHelperAsync(string path, string username)
{
var cfg = Globals.TryGetGlobal<AppSettings>("Settings");
if (!File.Exists(path))

var fileInfo = new FileInfo(path);
if (!fileInfo.Exists)
{
await Task.Delay(5000);
if (!File.Exists(path))
fileInfo = new FileInfo(path);
if (!fileInfo.Exists)
{
Dispatcher.UIThread.Post(() =>
{
Expand All @@ -193,8 +196,7 @@ public async Task LocalRequestHelperAsync(string path, string username)
}
}

var fileInfo = new FileInfo(path);
if ((fileInfo.Length / 2048) > cfg!.TwitchLocalRequestMaxSizeMB)
if ((fileInfo.Length / 1024) / 1024 > cfg!.TwitchLocalRequestMaxSizeMB)
{
Dispatcher.UIThread.Post(() =>
{
Expand Down

0 comments on commit fdcd54d

Please sign in to comment.