From 34b98123ae9d708ab37d83b75cd31ff77ff93ada Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Ben=C3=AD=C4=8Dek?= Date: Sat, 28 Jan 2023 19:37:04 +0100 Subject: [PATCH] update file searching in folder load --- PlayersStats.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/PlayersStats.cs b/PlayersStats.cs index c3cd2db..5e57c8c 100644 --- a/PlayersStats.cs +++ b/PlayersStats.cs @@ -77,12 +77,9 @@ namespace Lib_MCPlayerStats { List stats = new(); - foreach (string file in Directory.GetFiles(folder)) //Search all .json files for load in selected directory + foreach (string file in Directory.GetFiles(folder, "*.json", SearchOption.TopDirectoryOnly)) //Search all .json files for load in selected directory { - if (file.EndsWith(".json")) - { - stats.Add(await LoadPlayerAsync(file, rmc)); - } + stats.Add(await LoadPlayerAsync(file, rmc)); } return stats;