diff --git a/LANCommander.Playnite.Extension/ImportController.cs b/LANCommander.Playnite.Extension/ImportController.cs index fbc25733..46a81ab5 100644 --- a/LANCommander.Playnite.Extension/ImportController.cs +++ b/LANCommander.Playnite.Extension/ImportController.cs @@ -1,6 +1,7 @@ using LANCommander.PlaynitePlugin.Extensions; using LANCommander.SDK; using LANCommander.SDK.Extensions; +using LANCommander.SDK.Helpers; using Playnite.SDK; using Playnite.SDK.Models; using System; @@ -108,6 +109,24 @@ namespace LANCommander.PlaynitePlugin game.Name += " - Update Available"; } + if (!game.IsInstalled && String.IsNullOrWhiteSpace(game.InstallDirectory)) + { + try + { + // Check for existing manifest + var possibleInstallDirectory = Path.Combine(Plugin.Settings.InstallDirectory, game.Name.SanitizeFilename()); + + var existingManifest = ManifestHelper.Read(possibleInstallDirectory, game.Id); + + if (existingManifest != null) + { + game.IsInstalled = true; + game.InstallDirectory = possibleInstallDirectory; + } + } + catch { } + } + #region Play Sessions if (playSessions.Count() > 0) {