From 100e012fe6abc1471b1ce5e2d034f69c6bf94621 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Fri, 10 Mar 2023 10:27:09 -0500 Subject: [PATCH] Fix Redumper path generation --- CHANGELIST.md | 1 + MPF.Modules/Redumper/Parameters.cs | 40 ++++++++++++++++++++++-------- 2 files changed, 31 insertions(+), 10 deletions(-) diff --git a/CHANGELIST.md b/CHANGELIST.md index b917a3fe..0b80152e 100644 --- a/CHANGELIST.md +++ b/CHANGELIST.md @@ -86,6 +86,7 @@ - Update to DIC 20230309 - Fix errant forward slashes - Add TOC back as optional file +- Fix Redumper path generation ### 2.4 (2022-10-26) diff --git a/MPF.Modules/Redumper/Parameters.cs b/MPF.Modules/Redumper/Parameters.cs index 62a890ab..60064e2b 100644 --- a/MPF.Modules/Redumper/Parameters.cs +++ b/MPF.Modules/Redumper/Parameters.cs @@ -174,18 +174,32 @@ namespace MPF.Modules.Redumper switch (this.Type) { case MediaType.CDROM: - if (!File.Exists($"{basePath}.fulltoc")) - missingFiles.Add($"{basePath}.fulltoc"); - if (!File.Exists($"{basePath}.log")) - missingFiles.Add($"{basePath}.log"); + if (!File.Exists($"{basePath}.cue")) + missingFiles.Add($"{basePath}.cue"); if (!File.Exists($"{basePath}.scram") && !File.Exists($"{basePath}.scrap")) missingFiles.Add($"{basePath}.scram"); - if (!File.Exists($"{basePath}.state")) - missingFiles.Add($"{basePath}.state"); - if (!File.Exists($"{basePath}.subcode")) - missingFiles.Add($"{basePath}.subcode"); - if (!File.Exists($"{basePath}.toc")) - missingFiles.Add($"{basePath}.toc"); + + if (!File.Exists($"{basePath}_logs.zip") || !preCheck) + { + if (!File.Exists($"{basePath}.fulltoc")) + missingFiles.Add($"{basePath}.fulltoc"); + if (!File.Exists($"{basePath}.log")) + missingFiles.Add($"{basePath}.log"); + if (!File.Exists($"{basePath}.state")) + missingFiles.Add($"{basePath}.state"); + if (!File.Exists($"{basePath}.subcode")) + missingFiles.Add($"{basePath}.subcode"); + if (!File.Exists($"{basePath}.toc")) + missingFiles.Add($"{basePath}.toc"); + } + + // Removed or inconsistent files + if (false) + { + // Depends on the disc + if (!File.Exists($"{basePath}.cdtext")) + missingFiles.Add($"{basePath}.cdtext"); + } break; } @@ -633,11 +647,17 @@ namespace MPF.Modules.Redumper { string imagePath = Path.GetDirectoryName(filename); if (!string.IsNullOrWhiteSpace(imagePath)) + { + this[FlagStrings.ImagePath] = true; ImagePathValue = imagePath; + } string imageName = Path.GetFileName(filename); if (!string.IsNullOrWhiteSpace(imageName)) + { + this[FlagStrings.ImageName] = true; ImageNameValue = imageName; + } } this[FlagStrings.Retries] = true;