Fix issue where updating to v0.6.0 would duplicate library items and break some games
Playnite doesn't allow the editing of IDs. This fix removes the original game entry and adds the migrated one as a new game. Install status and directory are maintained.
This commit is contained in:
parent
da3bdb4f1f
commit
3d37da29fe
2 changed files with 4 additions and 19 deletions
|
|
@ -109,24 +109,6 @@ 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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -676,9 +676,12 @@ namespace LANCommander.PlaynitePlugin
|
|||
{
|
||||
try
|
||||
{
|
||||
var originalId = game.Id;
|
||||
|
||||
game.Id = Guid.Parse(game.GameId);
|
||||
|
||||
PlayniteApi.Database.Games.Update(game);
|
||||
PlayniteApi.Database.Games.Remove(originalId);
|
||||
PlayniteApi.Database.Games.Add(game);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue