diff --git a/source/Generic/LibraryExporter/LibraryExporterSettings.cs b/source/Generic/LibraryExporter/LibraryExporterSettings.cs index b48f372e8b..61c53bf514 100644 --- a/source/Generic/LibraryExporter/LibraryExporterSettings.cs +++ b/source/Generic/LibraryExporter/LibraryExporterSettings.cs @@ -94,6 +94,9 @@ public class ExportSettings : ObservableObject // Roms private bool roms = false; public bool Roms { get => roms; set => SetValue(ref roms, value); } + // CompletionStatus + private bool completionStatus = false; + public bool CompletionStatus { get => completionStatus; set => SetValue(ref completionStatus, value); } // Regions private bool regions = false; public bool Regions { get => regions; set => SetValue(ref regions, value); } diff --git a/source/Generic/LibraryExporter/ViewModels/LibraryExporterViewModel.cs b/source/Generic/LibraryExporter/ViewModels/LibraryExporterViewModel.cs index 0a0936e988..d3f88cee11 100644 --- a/source/Generic/LibraryExporter/ViewModels/LibraryExporterViewModel.cs +++ b/source/Generic/LibraryExporter/ViewModels/LibraryExporterViewModel.cs @@ -70,7 +70,7 @@ public void ExportGamesToCsv(IEnumerable games) logger.Error(e, $"Failed to export library to {selectedPath}"); playniteApi.Dialogs.ShowErrorMessage(ResourceProvider.GetString("LibraryExporterAdvanced_ExportFailedMessage").Format(selectedPath) + "\n\n" + e.Message); } - + } private List GetColumnsList() @@ -99,6 +99,7 @@ private List GetColumnsList() if (Settings.Settings.ExportSettings.Modified) { columnNames.Add(GetLocalizationString("LOCDateModifiedLabel")); } if (Settings.Settings.ExportSettings.RecentActivity) { columnNames.Add(GetLocalizationString("LOCRecentActivityLabel")); } if (Settings.Settings.ExportSettings.Roms) { columnNames.Add("Roms"); } + if (Settings.Settings.ExportSettings.CompletionStatus) { columnNames.Add(GetLocalizationString("LOCCompletionStatus")); } if (Settings.Settings.ExportSettings.Links) { columnNames.Add(GetLocalizationString("LOCLinksLabel")); } if (Settings.Settings.ExportSettings.Manual) { columnNames.Add(GetLocalizationString("LOCGameManualTitle")); } if (Settings.Settings.ExportSettings.Notes) { columnNames.Add(GetLocalizationString("LOCNotesLabel")); } @@ -244,6 +245,12 @@ private string[] GenerateGameColumns(int columnCount, Game game) currentInsertColumn++; } + if (Settings.Settings.ExportSettings.CompletionStatus) + { + properties[currentInsertColumn] = (game.CompletionStatus != null && !game.CompletionStatus.Name.IsNullOrEmpty() ? game.CompletionStatus.Name : string.Empty); + currentInsertColumn++; + } + if (Settings.Settings.ExportSettings.Links) { properties[currentInsertColumn] = game.Links?.HasItems() == true ? string.Join(Settings.Settings.ListsSeparator, game.Links.Select(x => $"{x.Name}:{x.Url}")) : string.Empty; @@ -339,7 +346,7 @@ private string[] GenerateGameColumns(int columnCount, Game game) properties[currentInsertColumn] = game.Id.ToString(); currentInsertColumn++; } - + return properties; } diff --git a/source/Generic/LibraryExporter/Views/LibraryExporterView.xaml b/source/Generic/LibraryExporter/Views/LibraryExporterView.xaml index 3051448cb9..2ca911cb98 100644 --- a/source/Generic/LibraryExporter/Views/LibraryExporterView.xaml +++ b/source/Generic/LibraryExporter/Views/LibraryExporterView.xaml @@ -64,6 +64,8 @@ Content="{DynamicResource LOCRecentActivityLabel}" Margin="0,0,0,5" /> +