From b448cf0c51ff7a1aed178899d42b20cd1be6b175 Mon Sep 17 00:00:00 2001 From: Lanta Date: Mon, 6 Nov 2023 15:46:41 +0100 Subject: [PATCH] always compare from yesterday --- update/matchparser.ps1 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/update/matchparser.ps1 b/update/matchparser.ps1 index f8c83bc..21dd5d8 100644 --- a/update/matchparser.ps1 +++ b/update/matchparser.ps1 @@ -58,7 +58,9 @@ try { $filesarray += [PSCustomObject]@{name = $file.Name; date = $dateTime } } - $latestFile = ($filesarray | where-object { $_.date -gt (get-date).AddDays(-1) } | Sort-Object date)[-1] + + $latestFile = ($filesarray | where-object { ($_.date -gt (get-date).AddDays(-2)) -and ($_.date -lt (get-date).AddDays(-1))} | Sort-Object date)[-1] + $latestFile = Get-Item -Path "$scriptroot/../data/archive/$($latestFile.name)" Write-Output "Found file $($latestFile.FullName)" } @@ -76,7 +78,7 @@ else { write-output 'setting old stats var empty' $oldstats = @() } - +start-sleep -Seconds 10 $all_player_matches = get-content "$scriptroot/../data/player_matches.json" | convertfrom-json -Depth 100