diff --git a/.vscode/launch.json b/.vscode/launch.json index b48fb02..3c2e4aa 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -11,6 +11,14 @@ "preLaunchTask": "build", "program": "${workspaceFolder}/bin/Debug/net8.0/win-x64/File-Folder-Helper.dll", "args": [ + "s", + "X", + "V:/1-Images-A/Images-0b793904", + "Day-Helper-2024-12-17", + ".job.json", + "thumbs.db~sync.ffs_db~verify.json~.html", + "I:/0-ISO-A", + "D:/5-Other-Small/Disk/Snap2HTML/Snap2HTML.exe", "s", "X", "V:/Tmp/Phares/Helper-2025-07-20", diff --git a/ADO2024/PI4/Helper-2024-12-17.cs b/ADO2024/PI4/Helper-2024-12-17.cs index 9d930b7..36eaaff 100644 --- a/ADO2024/PI4/Helper-2024-12-17.cs +++ b/ADO2024/PI4/Helper-2024-12-17.cs @@ -96,12 +96,15 @@ internal static partial class Helper20241217 if (record.Job is null || string.IsNullOrEmpty(record.Job.Extension)) continue; logger.LogInformation("Searching <{directory}>", record.SourceDirectory); - if (snap2HyperTextMarkupLanguage is not null && System.IO.File.Exists(snap2HyperTextMarkupLanguage)) - WriteSnap2HyperTextMarkupLanguage(logger, snap2HyperTextMarkupLanguage, record); files = GetFiles(searchPattern, ignoreFileNames, record); jobNew = GetJob(searchPattern, ignoreFileNames, record, files); json = JsonSerializer.Serialize(jobNew, JobSourceGenerationContext.Default.Job); areTheyTheSame = GetAreTheyTheSame(logger, searchPattern, ignoreFileNames, record, jobNew); + if (snap2HyperTextMarkupLanguage is not null && System.IO.File.Exists(snap2HyperTextMarkupLanguage)) + { + if (!areTheyTheSame || (areTheyTheSame && !System.IO.File.Exists(record.Snap2HyperTextMarkupLanguage))) + WriteSnap2HyperTextMarkupLanguage(logger, snap2HyperTextMarkupLanguage, record); + } if (areTheyTheSame) { WriteAllText(record.Path, json); @@ -109,10 +112,10 @@ internal static partial class Helper20241217 } fileName = $"{record.DirectoryName}-{DateTime.Now:yyyy-MM-dd-HH-mm-ss-fff}{record.Job.Extension}"; path = Path.Combine(record.DestinationDirectory, fileName); - logger.LogInformation("Writing <{path}> extension", path); + logger.LogWarning("Writing <{path}> extension", path); WritePassedExtension(record, files, record.DirectoryName, path); - logger.LogInformation("Wrote <{path}> extension", path); - logger.LogInformation("Moved <{path}> extension", path); + logger.LogWarning("Wrote <{path}> extension", path); + logger.LogWarning("Moved <{path}> extension", path); WriteAllText(record, json, path); } } @@ -276,7 +279,7 @@ internal static partial class Helper20241217 if (filesCountNew != filesCountOld) { result = false; - logger.LogInformation("<{directory}> file count has changed {filesCountNew} != {filesCountOld}", record.SourceDirectory, filesCountNew, filesCountOld); + logger.LogWarning("<{directory}> file count has changed {filesCountNew} != {filesCountOld}", record.SourceDirectory, filesCountNew, filesCountOld); } else { @@ -285,7 +288,7 @@ internal static partial class Helper20241217 if (filesTotalLengthNew != filesTotalLengthOld) { result = false; - logger.LogInformation("<{directory}> file length has changed {filesTotalLengthNew} != {filesTotalLengthOld}", record.SourceDirectory, filesTotalLengthNew, filesTotalLengthOld); + logger.LogWarning("<{directory}> file length has changed {filesTotalLengthNew} != {filesTotalLengthOld}", record.SourceDirectory, filesTotalLengthNew, filesTotalLengthOld); } else { @@ -301,7 +304,7 @@ internal static partial class Helper20241217 WriteAllText(Path.Combine(Environment.CurrentDirectory, ".vscode", "helper", "old.json"), jsonOld); WriteAllText(Path.Combine(Environment.CurrentDirectory, ".vscode", "helper", "new.json"), jsonNew); } - logger.LogInformation("<{directory}> file serialized are different {filesTotalLengthNew} != {filesTotalLengthOld}", record.SourceDirectory, filesTotalLengthNew, filesTotalLengthOld); + logger.LogWarning("<{directory}> file serialized are different {filesTotalLengthNew} != {filesTotalLengthOld}", record.SourceDirectory, filesTotalLengthNew, filesTotalLengthOld); } } }