From 22fdd036eb7bb000bfff7302fa129941d3420832 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Fri, 23 Aug 2024 16:23:45 -0400 Subject: [PATCH] Fix new AddToArchive methods --- CHANGELIST.md | 1 + MPF.Processors/BaseProcessor.cs | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CHANGELIST.md b/CHANGELIST.md index 01a31373..aff39d1e 100644 --- a/CHANGELIST.md +++ b/CHANGELIST.md @@ -45,6 +45,7 @@ - Fix up some file path methods - Fix broken build - Rearrange some BaseProcessor methods +- Fix new AddToArchive methods ### 3.2.1 (2024-08-05) diff --git a/MPF.Processors/BaseProcessor.cs b/MPF.Processors/BaseProcessor.cs index 35a411a9..7216c8be 100644 --- a/MPF.Processors/BaseProcessor.cs +++ b/MPF.Processors/BaseProcessor.cs @@ -259,7 +259,7 @@ namespace MPF.Processors /// Directory that the existing files live in /// Indicates if the files should be deleted after adding /// True if all files were added successfully, false otherwise - private bool AddToArchive(ZipArchive archive, List files, string? outputDirectory, bool delete) + private static bool AddToArchive(ZipArchive archive, List files, string? outputDirectory, bool delete) { // An empty list means success if (files.Count == 0) @@ -267,7 +267,7 @@ namespace MPF.Processors // Loop through and add all files bool allAdded = true; - for (string file in files) + foreach (string file in files) { allAdded &= AddToArchive(archive, files, outputDirectory, delete); } @@ -283,7 +283,7 @@ namespace MPF.Processors /// Directory that the existing file lives in /// Indicates if the file should be deleted after adding /// True if the file was added successfully, false otherwise - private bool AddToArchive(ZipArchive archive, string file, string? outputDirectory, bool delete) + private static bool AddToArchive(ZipArchive archive, string file, string? outputDirectory, bool delete) { // Check if the file exists if (!File.Exists(file))