diff --git a/CreamInstaller/Forms/SelectForm.cs b/CreamInstaller/Forms/SelectForm.cs index 2903d8a..8a17be2 100644 --- a/CreamInstaller/Forms/SelectForm.cs +++ b/CreamInstaller/Forms/SelectForm.cs @@ -172,6 +172,7 @@ internal sealed partial class SelectForm : CustomForm if (dllDirectories is null) { Interlocked.Decrement(ref steamGamesToCheck); + DebugForm.Current.Log("no dll " + appId + " - " + name); RemoveFromRemainingGames(name); return; } @@ -192,6 +193,7 @@ internal sealed partial class SelectForm : CustomForm dlcIds.AddRange(await SteamStore.ParseDlcAppIds(appData)); if (appInfo is not null) dlcIds.AddRange(await SteamCMD.ParseDlcAppIds(appInfo)); + dlcIds = dlcIds.Distinct().ToList(); if (dlcIds.Count > 0) foreach (string dlcAppId in dlcIds) { @@ -528,9 +530,9 @@ internal sealed partial class SelectForm : CustomForm gameChoices.Add((Platform.Steam, appId, name, programsToScan is not null && programsToScan.Any(p => p.platform is Platform.Steam && p.id == appId))); if (EpicLibrary.EpicManifestsPath.DirectoryExists()) - foreach (Manifest manifest in (await EpicLibrary.GetGames()).Where(m => !Program.IsGameBlocked(m.DisplayName, m.InstallLocation))) - gameChoices.Add((Platform.Epic, manifest.CatalogNamespace, manifest.DisplayName, - programsToScan is not null && programsToScan.Any(p => p.platform is Platform.Epic && p.id == manifest.CatalogNamespace))); + gameChoices.AddRange((await EpicLibrary.GetGames()).Where(m => !Program.IsGameBlocked(m.DisplayName, m.InstallLocation)).Select(manifest + => (Platform.Epic, manifest.CatalogNamespace, manifest.DisplayName, + programsToScan is not null && programsToScan.Any(p => p.platform is Platform.Epic && p.id == manifest.CatalogNamespace)))); foreach ((string gameId, string name, string _) in (await UbisoftLibrary.GetGames()).Where(g => !Program.IsGameBlocked(g.name, g.gameDirectory))) gameChoices.Add((Platform.Ubisoft, gameId, name, programsToScan is not null && programsToScan.Any(p => p.platform is Platform.Ubisoft && p.id == gameId))); @@ -678,7 +680,7 @@ internal sealed partial class SelectForm : CustomForm } } - private List GatherTreeNodes(TreeNodeCollection nodeCollection) + private static List GatherTreeNodes(TreeNodeCollection nodeCollection) { List treeNodes = new(); foreach (TreeNode rootNode in nodeCollection) diff --git a/CreamInstaller/Utility/SafeIO.cs b/CreamInstaller/Utility/SafeIO.cs index edf1f9e..070017a 100644 --- a/CreamInstaller/Utility/SafeIO.cs +++ b/CreamInstaller/Utility/SafeIO.cs @@ -89,12 +89,15 @@ internal static class SafeIO return Enumerable.Empty(); } - internal static IEnumerable EnumerateSubdirectories(this string directoryPath, string directoryPattern, bool crucial = false, Form form = null) + internal static IEnumerable EnumerateSubdirectories(this string directoryPath, string directoryPattern, bool subdirectories = false, + bool crucial = false, Form form = null) { while (!Program.Canceled) try { - return Directory.EnumerateDirectories(directoryPath, directoryPattern); + return subdirectories + ? Directory.EnumerateDirectories(directoryPath, directoryPattern, new EnumerationOptions { RecurseSubdirectories = true }) + : Directory.EnumerateDirectories(directoryPath, directoryPattern); } catch {