diff --git a/CHANGELIST.md b/CHANGELIST.md index 05258d7f..64fb783b 100644 --- a/CHANGELIST.md +++ b/CHANGELIST.md @@ -3,6 +3,7 @@ - Add BCA to list of files to select in Check UI - Move Zstd compression helper to base processor - Add file merge method in CleanRip +- Implement file merging in CleanRip ### 3.5.0 (2025-10-10) diff --git a/MPF.Processors/CleanRip.cs b/MPF.Processors/CleanRip.cs index 70f9447d..68a09e8f 100644 --- a/MPF.Processors/CleanRip.cs +++ b/MPF.Processors/CleanRip.cs @@ -38,6 +38,9 @@ namespace MPF.Processors // TODO: Determine if there's a CleanRip version anywhere info.DumpingInfo!.DumpingDate = ProcessingTool.GetFileModifiedDate($"{basePath}-dumpinfo.txt")?.ToString("yyyy-MM-dd HH:mm:ss"); + // Try to merge parts together, if needed + _ = MergeFileParts(basePath); + // Get the Datafile information var datafile = GenerateCleanripDatafile($"{basePath}.iso", $"{basePath}-dumpinfo.txt"); info.TracksAndWriteOffsets!.ClrMameProData = ProcessingTool.GenerateDatfile(datafile); @@ -103,6 +106,10 @@ namespace MPF.Processors /// This assumes that all file parts are named like $"{basePath}.part{i}.iso" internal static string? MergeFileParts(string basePath) { + // If the expected output already exists + if (File.Exists($"{basePath}.iso")) + return $"{basePath}.iso"; + // If the first part does not exist if (!File.Exists($"{basePath}.part0.iso")) return null;