From f1185c242cfbd1c154f7f61bde677f316ad335f2 Mon Sep 17 00:00:00 2001 From: Schedel Pascal Date: Fri, 21 Jun 2024 06:45:33 +0200 Subject: [PATCH] Revert "completely revert extra property" This reverts commit 1746bb6442aee2ecdfae85c075f02b14839d60e5. --- ModpackUpdater.Manager/ModpackInstaller.cs | 4 ++-- ModpackUpdater.Model/InstallAction.cs | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ModpackUpdater.Manager/ModpackInstaller.cs b/ModpackUpdater.Manager/ModpackInstaller.cs index 0e2bd29..2aa2f49 100644 --- a/ModpackUpdater.Manager/ModpackInstaller.cs +++ b/ModpackUpdater.Manager/ModpackInstaller.cs @@ -56,7 +56,7 @@ public class ModpackInstaller(ModpackConfig updateConfig, ModpackInfo modpackInf if (installInfos is not null && installInfos.Actions.Count != 0) { - var actions = installInfos.Actions.Where(n => n.Side.IsSide(options.Side)); + var actions = installInfos.Actions.Where(n => n.Side.IsSide(options.Side) && (!n.IsExtra || updateConfig.AllowExtras)); if (actions.Any()) { result.Actions.AddRange(installInfos.Actions); @@ -88,7 +88,7 @@ public class ModpackInstaller(ModpackConfig updateConfig, ModpackInfo modpackInf foreach (var action in checkingVersion.Actions) { - if (action.Side.IsSide(options.Side) && !result.Actions.Any(n => n.DestPath == action.DestPath)) + if (action.Side.IsSide(options.Side) && (!action.IsExtra || updateConfig.AllowExtras) && !result.Actions.Any(n => n.DestPath == action.DestPath)) actionsToAdd.Add(action); } diff --git a/ModpackUpdater.Model/InstallAction.cs b/ModpackUpdater.Model/InstallAction.cs index 7ec563f..4343378 100644 --- a/ModpackUpdater.Model/InstallAction.cs +++ b/ModpackUpdater.Model/InstallAction.cs @@ -7,4 +7,5 @@ public class InstallAction public string DestPath { get; set; } public string DownloadUrl { get; set; } public Side Side { get; set; } = Side.Both; + public bool IsExtra { get; set; } } \ No newline at end of file