diff --git a/.vscode/launch.json b/.vscode/launch.json index 8fedabc..585c9b9 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -18,7 +18,8 @@ "4e+9", "L:/Git/AA/Rename/.vscode/.UserSecrets/secrets.json", ".avif~.bmp~.gif~.heic~.insp~.jp2~.jpe~.jpeg~.jpg~.jxl~.png~.psd~.raw~.rw2~.svg~.tif~.tiff~.webp~.3gp~.3gpp~.avi~.dvr-ms~.flv~.insv~.m2t~.m2ts~.m4v~.mkv~.mov~.mp4~.mpe~.mpeg~.mpg~.mts~.ts~.webm~.wmv", - "P:/6-Other-Large-Z/Current-Results/C)Resize/0b793904/Original/(helper)", + "P:/6-Other-Large-Z/Current-Results/C)Resize/0b793904/Original", + "(helper)", "s", "X", "P:/1-Images-A/Images-0b793904", diff --git a/ADO2025/PI6/Helper-2025-07-26.cs b/ADO2025/PI6/Helper-2025-07-26.cs index bc188fc..723d951 100644 --- a/ADO2025/PI6/Helper-2025-07-26.cs +++ b/ADO2025/PI6/Helper-2025-07-26.cs @@ -25,6 +25,7 @@ internal static partial class Helper20250726 { logger.LogInformation(args[3]); logger.LogInformation(args[4]); logger.LogInformation(args[5]); + logger.LogInformation(args[6]); string[] files; string[] searchPatterns = args[4].Split('~'); string jsonFile = Path.GetFullPath(args[3]); @@ -33,6 +34,7 @@ internal static partial class Helper20250726 { } ReadOnlyCollection records; string json = File.ReadAllText(jsonFile); + string destinationDirectoryName = args[6]; ReadOnlyDictionary> keyValues; string sourceDirectory = Path.GetFullPath(args[0].Split('~')[0]); string destinationDirectory = Path.GetFullPath(args[5].Split('~')[0]); @@ -49,7 +51,7 @@ internal static partial class Helper20250726 { continue; } logger.LogInformation($"Found {files.Length} {searchPattern} files"); - keyValuePairs = GetKeyValuePairs(destinationDirectory, settings.ResultSettings); + keyValuePairs = GetKeyValuePairs(settings.ResultSettings, destinationDirectory, destinationDirectoryName); records = GetRecords(logger, settings.ResultSettings, settings.MetadataSettings, files); keyValues = keyValuePairs.ElementAt(0).Value; CopyToCombinedEnumAndIndexFormat(logger, maxSize, records, keyValues); @@ -57,12 +59,12 @@ internal static partial class Helper20250726 { Helpers.HelperDeleteEmptyDirectories.DeleteEmptyDirectories(logger, destinationDirectory); } - private static ReadOnlyDictionary>> GetKeyValuePairs(string destinationDirectory, ResultSettings resultSettings) { + private static ReadOnlyDictionary>> GetKeyValuePairs(ResultSettings resultSettings, string destinationDirectory, string destinationDirectoryName) { Dictionary>> results = []; - ReadOnlyDictionary>>> keyValuePairs = IPath.GetKeyValuePairs(resultSettings, destinationDirectory, [resultSettings.ResultSingleton]); + ReadOnlyDictionary>>> keyValuePairs = IPath.GetKeyValuePairs(resultSettings, destinationDirectory, [destinationDirectoryName]); foreach (KeyValuePair>>> keyValuePair in keyValuePairs) { foreach (KeyValuePair>> keyValue in keyValuePair.Value) { - if (keyValue.Key != resultSettings.ResultSingleton) + if (keyValue.Key != destinationDirectoryName) throw new Exception("Never should happen!"); results.Add(keyValuePair.Key, keyValue.Value); }