From b8e9a8c8cd7db90979cb997e8539cfbfadf4c747 Mon Sep 17 00:00:00 2001 From: Pat Hartl Date: Sat, 28 Feb 2026 17:51:30 -0600 Subject: [PATCH] Fix redist/tool/server exports Fixes various issues that may prevent redistributables, tools, or servers from being exported properly. --- LANCommander.Server.ImportExport/ExportContext.cs | 2 ++ .../Exporters/RedistributableExporter.cs | 10 +++++++++- .../Exporters/ServerExporter.cs | 14 ++++++++++++++ .../Exporters/ToolExporter.cs | 14 +++++++++++++- 4 files changed, 38 insertions(+), 2 deletions(-) diff --git a/LANCommander.Server.ImportExport/ExportContext.cs b/LANCommander.Server.ImportExport/ExportContext.cs index 08dcbd8d..fe590ef8 100644 --- a/LANCommander.Server.ImportExport/ExportContext.cs +++ b/LANCommander.Server.ImportExport/ExportContext.cs @@ -500,6 +500,8 @@ public class ExportContext( manifest.Archives.Add(await ExportRecordAsync(queueItem, Archives)); else if (queueItem.Type == ImportExportRecordType.Script) manifest.Scripts.Add(await ExportRecordAsync(queueItem, Scripts)); + else if (queueItem.Type == ImportExportRecordType.Action) + manifest.Actions.Add(await ExportRecordAsync(queueItem, Actions)); } return manifest; diff --git a/LANCommander.Server.ImportExport/Exporters/RedistributableExporter.cs b/LANCommander.Server.ImportExport/Exporters/RedistributableExporter.cs index 5922a168..4bd3fd59 100644 --- a/LANCommander.Server.ImportExport/Exporters/RedistributableExporter.cs +++ b/LANCommander.Server.ImportExport/Exporters/RedistributableExporter.cs @@ -20,6 +20,14 @@ public class RedistributableExporter(RedistributableService redistributableServi public override async Task ExportAsync(Guid id) { - return await redistributableService.GetAsync(id); + var redistributable = await redistributableService.GetAsync(id); + + if (redistributable.Archives is null) + redistributable.Archives = new List(); + + if (redistributable.Scripts is null) + redistributable.Scripts = new List