diff --git a/LANCommander.Playnite.Extension/LANCommanderLibraryPlugin.cs b/LANCommander.Playnite.Extension/LANCommanderLibraryPlugin.cs index c13eb4b..b69a3ff 100644 --- a/LANCommander.Playnite.Extension/LANCommanderLibraryPlugin.cs +++ b/LANCommander.Playnite.Extension/LANCommanderLibraryPlugin.cs @@ -85,7 +85,7 @@ namespace LANCommander.PlaynitePlugin var metadata = new GameMetadata() { - IsInstalled = existingGame != null, + IsInstalled = false, Name = manifest.Title, SortingName = manifest.SortTitle, Description = manifest.Description, @@ -93,9 +93,24 @@ namespace LANCommander.PlaynitePlugin ReleaseDate = new ReleaseDate(manifest.ReleasedOn), //Version = game.Archives.OrderByDescending(a => a.CreatedOn).FirstOrDefault().Version, Icon = new MetadataFile(iconUri.ToString()), - Genres = new HashSet() + GameActions = game.Actions.Select(a => new PN.SDK.Models.GameAction() + { + Name = a.Name, + Arguments = a.Arguments, + Path = a.Path, + WorkingDir = a.WorkingDirectory, + IsPlayAction = a.PrimaryAction + }).ToList() }; + if (existingGame != null) + { + metadata.IsInstalled = true; + metadata.Version = existingGame.Version; + metadata.InstallDirectory = existingGame.InstallDirectory; + metadata.InstallSize = existingGame.InstallSize; + } + if (manifest.Genre != null && manifest.Genre.Count() > 0) metadata.Genres = new HashSet(manifest.Genre.Select(g => new MetadataNameProperty(g))); diff --git a/LANCommander.Playnite.Extension/Views/LANCommanderSettingsView.xaml.cs b/LANCommander.Playnite.Extension/Views/LANCommanderSettingsView.xaml.cs index 146f06d..d625ca7 100644 --- a/LANCommander.Playnite.Extension/Views/LANCommanderSettingsView.xaml.cs +++ b/LANCommander.Playnite.Extension/Views/LANCommanderSettingsView.xaml.cs @@ -51,7 +51,7 @@ namespace LANCommander.PlaynitePlugin { try { - Dispatcher.Invoke(new Action(() => + Dispatcher.Invoke(new System.Action(() => { if (antecedent.Result == false) { diff --git a/LANCommander.SDK/Models/Action.cs b/LANCommander.SDK/Models/Action.cs new file mode 100644 index 0000000..e7880e8 --- /dev/null +++ b/LANCommander.SDK/Models/Action.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace LANCommander.SDK.Models +{ + public class Action + { + public string Name { get; set; } + public string Arguments { get; set; } + public string Path { get; set; } + public string WorkingDirectory { get; set; } + public bool PrimaryAction { get; set; } + } +} diff --git a/LANCommander.SDK/Models/Game.cs b/LANCommander.SDK/Models/Game.cs index 6d504d0..d0dfe55 100644 --- a/LANCommander.SDK/Models/Game.cs +++ b/LANCommander.SDK/Models/Game.cs @@ -10,6 +10,7 @@ namespace LANCommander.SDK.Models public string DirectoryName { get; set; } public string Description { get; set; } public DateTime ReleasedOn { get; set; } + public virtual IEnumerable Actions { get; set; } public virtual IEnumerable Tags { get; set; } public virtual Company Publisher { get; set; } public virtual Company Developer { get; set; }