Skip to content

Commit

Permalink
Hotfix for shitcode
Browse files Browse the repository at this point in the history
  • Loading branch information
Simyon264 committed Jun 5, 2024
1 parent 1876036 commit 2d07ac1
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions ReplayBrowser/Services/ReplayParser/ReplayParserService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -274,11 +274,23 @@ public async Task AddReplayToQueue(string replay)
var match = storageUrl.ReplayRegexCompiled.Match(fileName);
if (match.Success)
{
var date = DateTime.ParseExact(match.Groups[1].Value, "yyyy_MM_dd-HH_mm", CultureInfo.InvariantCulture);
if (date < CutOffDateTime)
try
{
return;
var date = DateTime.ParseExact(match.Groups[1].Value, "yyyy_MM_dd-HH_mm", CultureInfo.InvariantCulture);
if (date < CutOffDateTime)
{
return;
}
}
catch (FormatException e)
{
var date = DateTime.ParseExact(match.Groups[1].Value, "yyyy-MM-dd", CultureInfo.InvariantCulture);
if (date < CutOffDateTime)
{
return;
}
}

} else
{
Log.Warning("Replay " + replay + " does not match the regex.");
Expand Down

0 comments on commit 2d07ac1

Please sign in to comment.