Check for potentially existing game install when importing games
This commit is contained in:
parent
532c219924
commit
2dd6742cd6
1 changed files with 19 additions and 0 deletions
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue