Implement file merging in CleanRip

This commit is contained in:
Matt Nadareski
2025-10-10 11:40:02 -04:00
parent 1b62ed0c03
commit 882243316c
2 changed files with 8 additions and 0 deletions

View File

@@ -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)

View File

@@ -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
/// <remarks>This assumes that all file parts are named like $"{basePath}.part{i}.iso"</remarks>
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;