From 91c6fdac8244a812ee023513f7377e7b53e21fe2 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Fri, 23 Aug 2024 20:39:30 -0400 Subject: [PATCH] Use simplified CheckAllOutputFilesExist --- CHANGELIST.md | 1 + MPF.Processors/Aaru.cs | 61 ---------- MPF.Processors/BaseProcessor.cs | 147 ++++++++++++------------ MPF.Processors/CleanRip.cs | 36 ------ MPF.Processors/DiscImageCreator.cs | 167 ++-------------------------- MPF.Processors/PS3CFW.cs | 30 ----- MPF.Processors/Redumper.cs | 124 --------------------- MPF.Processors/UmdImageCreator.cs | 38 ------- MPF.Processors/XboxBackupCreator.cs | 47 -------- 9 files changed, 83 insertions(+), 568 deletions(-) diff --git a/CHANGELIST.md b/CHANGELIST.md index 4afeac7c..d31558f2 100644 --- a/CHANGELIST.md +++ b/CHANGELIST.md @@ -54,6 +54,7 @@ - Minor tweaks to existing code - Add new, unused CheckAllOutputFilesExist variant - Rename new method to CheckRequiredFiles +- Use simplified CheckAllOutputFilesExist ### 3.2.1 (2024-08-05) diff --git a/MPF.Processors/Aaru.cs b/MPF.Processors/Aaru.cs index 6abf43dc..551bf5ad 100644 --- a/MPF.Processors/Aaru.cs +++ b/MPF.Processors/Aaru.cs @@ -27,67 +27,6 @@ namespace MPF.Processors #region BaseProcessor Implementations - /// - public override (bool, List) CheckAllOutputFilesExist(string basePath, bool preCheck) - { - // Get the base filename and directory from the base path - string baseFilename = Path.GetFileName(basePath); - string baseDirectory = Path.GetDirectoryName(basePath) ?? string.Empty; - - // Get the list of output files - var outputFiles = GetOutputFiles(baseFilename); - if (outputFiles.Count == 0) - return (false, ["Media and system combination not supported for Aaru"]); - - var missingFiles = new List(); - switch (Type) - { - case MediaType.CDROM: - if (!File.Exists($"{basePath}_logs.zip") || !preCheck) - { - if (!File.Exists($"{basePath}.cicm.xml")) - missingFiles.Add($"{basePath}.cicm.xml"); - if (!File.Exists($"{basePath}.ibg")) - missingFiles.Add($"{basePath}.ibg"); - if (!File.Exists($"{basePath}.log")) - missingFiles.Add($"{basePath}.log"); - if (!File.Exists($"{basePath}.mhddlog.bin")) - missingFiles.Add($"{basePath}.mhddlog.bin"); - if (!File.Exists($"{basePath}.resume.xml")) - missingFiles.Add($"{basePath}.resume.xml"); - if (!File.Exists($"{basePath}.sub.log")) - missingFiles.Add($"{basePath}.sub.log"); - } - - break; - - case MediaType.DVD: - case MediaType.HDDVD: - case MediaType.BluRay: - if (!File.Exists($"{basePath}_logs.zip") || !preCheck) - { - if (!File.Exists($"{basePath}.cicm.xml")) - missingFiles.Add($"{basePath}.cicm.xml"); - if (!File.Exists($"{basePath}.ibg")) - missingFiles.Add($"{basePath}.ibg"); - if (!File.Exists($"{basePath}.log")) - missingFiles.Add($"{basePath}.log"); - if (!File.Exists($"{basePath}.mhddlog.bin")) - missingFiles.Add($"{basePath}.mhddlog.bin"); - if (!File.Exists($"{basePath}.resume.xml")) - missingFiles.Add($"{basePath}.resume.xml"); - } - - break; - - default: - missingFiles.Add("Media and system combination not supported for Aaru"); - break; - } - - return (!missingFiles.Any(), missingFiles); - } - /// public override void GenerateSubmissionInfo(SubmissionInfo info, string basePath, bool redumpCompat) { diff --git a/MPF.Processors/BaseProcessor.cs b/MPF.Processors/BaseProcessor.cs index f29b2d60..4f2695a4 100644 --- a/MPF.Processors/BaseProcessor.cs +++ b/MPF.Processors/BaseProcessor.cs @@ -50,7 +50,8 @@ namespace MPF.Processors /// Base filename and path to use for checking /// True if this is a check done before a dump, false if done after /// Tuple of true if all required files exist, false otherwise and a list representing missing files - public abstract (bool, List) CheckAllOutputFilesExist(string basePath, bool preCheck); + public virtual (bool, List) CheckAllOutputFilesExist(string basePath, bool preCheck) + => CheckRequiredFiles(basePath); /// /// Generate a SubmissionInfo for the output files @@ -250,78 +251,6 @@ namespace MPF.Processors return artifacts; } - /// - /// Validate if all required output files exist - /// - /// Base filename and path to use for checking - /// Tuple of true if all required files exist, false otherwise and a list representing missing files - protected (bool, List) CheckRequiredFiles(string basePath) - { - // Get the base filename and directory from the base path - string baseFilename = Path.GetFileName(basePath); - string baseDirectory = Path.GetDirectoryName(basePath) ?? string.Empty; - - // Get the list of output files - var outputFiles = GetOutputFiles(baseFilename); - if (outputFiles.Count == 0) - return (false, ["Media and system combination not supported"]); - - // Check for the log file - bool logArchiveExists = false; -#if NET452_OR_GREATER || NETCOREAPP - ZipArchive? logArchive = null; -#endif - if (File.Exists($"{basePath}_logs.zip")) - { - logArchiveExists = true; -#if NET452_OR_GREATER || NETCOREAPP - try - { - // Try to open the archive - logArchive = ZipFile.OpenRead($"{basePath}_logs.zip"); - } - catch - { - logArchiveExists = false; - } -#endif - } - - // Get a list of all missing required files - var missingFiles = new List(); - foreach (var outputFile in outputFiles) - { - // Only check required files - if (!outputFile.IsRequired) - continue; - - // Use the built-in existence function - if (outputFile.Exists(baseDirectory)) - continue; - - // If the log archive doesn't exist - if (!logArchiveExists) - { - missingFiles.Add(outputFile.Filenames[0]); - continue; - } - -#if NET20 || NET35 || NET40 - // Assume the zipfile has the file in it - continue; -#else - // Check the log archive - if (outputFile.Exists(logArchive)) - continue; - - // Add the file to the missing list - missingFiles.Add(outputFile.Filenames[0]); -#endif - } - - return (!missingFiles.Any(), missingFiles); - } - #if NET452_OR_GREATER || NETCOREAPP /// /// Try to add a set of files to an existing archive @@ -393,6 +322,78 @@ namespace MPF.Processors } #endif + /// + /// Validate if all required output files exist + /// + /// Base filename and path to use for checking + /// Tuple of true if all required files exist, false otherwise and a list representing missing files + private (bool, List) CheckRequiredFiles(string basePath) + { + // Get the base filename and directory from the base path + string baseFilename = Path.GetFileName(basePath); + string baseDirectory = Path.GetDirectoryName(basePath) ?? string.Empty; + + // Get the list of output files + var outputFiles = GetOutputFiles(baseFilename); + if (outputFiles.Count == 0) + return (false, ["Media and system combination not supported"]); + + // Check for the log file + bool logArchiveExists = false; +#if NET452_OR_GREATER || NETCOREAPP + ZipArchive? logArchive = null; +#endif + if (File.Exists($"{basePath}_logs.zip")) + { + logArchiveExists = true; +#if NET452_OR_GREATER || NETCOREAPP + try + { + // Try to open the archive + logArchive = ZipFile.OpenRead($"{basePath}_logs.zip"); + } + catch + { + logArchiveExists = false; + } +#endif + } + + // Get a list of all missing required files + var missingFiles = new List(); + foreach (var outputFile in outputFiles) + { + // Only check required files + if (!outputFile.IsRequired) + continue; + + // Use the built-in existence function + if (outputFile.Exists(baseDirectory)) + continue; + + // If the log archive doesn't exist + if (!logArchiveExists) + { + missingFiles.Add(outputFile.Filenames[0]); + continue; + } + +#if NET20 || NET35 || NET40 + // Assume the zipfile has the file in it + continue; +#else + // Check the log archive + if (outputFile.Exists(logArchive)) + continue; + + // Add the file to the missing list + missingFiles.Add(outputFile.Filenames[0]); +#endif + } + + return (!missingFiles.Any(), missingFiles); + } + /// /// Generate a list of all deleteable filenames /// diff --git a/MPF.Processors/CleanRip.cs b/MPF.Processors/CleanRip.cs index 747e3ede..ec25df95 100644 --- a/MPF.Processors/CleanRip.cs +++ b/MPF.Processors/CleanRip.cs @@ -19,42 +19,6 @@ namespace MPF.Processors #region BaseProcessor Implementations - /// - public override (bool, List) CheckAllOutputFilesExist(string basePath, bool preCheck) - { - // Get the base filename and directory from the base path - string baseFilename = Path.GetFileName(basePath); - string baseDirectory = Path.GetDirectoryName(basePath) ?? string.Empty; - - // Get the list of output files - var outputFiles = GetOutputFiles(baseFilename); - if (outputFiles.Count == 0) - return (false, ["Media and system combination not supported for CleanRip"]); - - var missingFiles = new List(); - switch (Type) - { - case MediaType.DVD: // Only added here to help users; not strictly correct - case MediaType.NintendoGameCubeGameDisc: - case MediaType.NintendoWiiOpticalDisc: - if (!File.Exists($"{basePath}_logs.zip") || !preCheck) - { - if (!File.Exists($"{basePath}-dumpinfo.txt")) - missingFiles.Add($"{basePath}-dumpinfo.txt"); - if (!File.Exists($"{basePath}.bca")) - missingFiles.Add($"{basePath}.bca"); - } - - break; - - default: - missingFiles.Add("Media and system combination not supported for CleanRip"); - break; - } - - return (!missingFiles.Any(), missingFiles); - } - /// public override void GenerateSubmissionInfo(SubmissionInfo info, string basePath, bool redumpCompat) { diff --git a/MPF.Processors/DiscImageCreator.cs b/MPF.Processors/DiscImageCreator.cs index aecc9de6..9804452b 100644 --- a/MPF.Processors/DiscImageCreator.cs +++ b/MPF.Processors/DiscImageCreator.cs @@ -70,169 +70,18 @@ namespace MPF.Processors - volDesc - Volume descriptor information */ - // Get the base filename and directory from the base path - string baseFilename = Path.GetFileName(basePath); - string baseDirectory = Path.GetDirectoryName(basePath) ?? string.Empty; + // Use the base check first + (bool allFound, List missingFiles) = base.CheckAllOutputFilesExist(basePath, preCheck); - // Get the list of output files - var outputFiles = GetOutputFiles(baseFilename); - if (outputFiles.Count == 0) - return (false, ["Media and system combination not supported for DiscImageCreator"]); - - var missingFiles = new List(); - switch (Type) + // Check for the command file + (string? commandPath, _) = GetCommandFilePathAndVersion(basePath); + if (commandPath == null) { - case MediaType.CDROM: - case MediaType.GDROM: - if (!File.Exists($"{basePath}.cue")) - missingFiles.Add($"{basePath}.cue"); - if (!File.Exists($"{basePath}.img") && !File.Exists($"{basePath}.imgtmp")) - missingFiles.Add($"{basePath}.img"); - - // Audio-only discs don't output these files - if (!System.IsAudio()) - { - if (!File.Exists($"{basePath}.scm") && !File.Exists($"{basePath}.scmtmp")) - missingFiles.Add($"{basePath}.scm"); - } - - if (!File.Exists($"{basePath}_logs.zip") || !preCheck) - { - // GD-ROM and GD-R don't output this for the HD area - if (Type != MediaType.GDROM) - { - if (!File.Exists($"{basePath}.ccd")) - missingFiles.Add($"{basePath}.ccd"); - } - - if (!File.Exists($"{basePath}.dat")) - missingFiles.Add($"{basePath}.dat"); - if (!File.Exists($"{basePath}.sub") && !File.Exists($"{basePath}.subtmp")) - missingFiles.Add($"{basePath}.sub"); - if (!File.Exists($"{basePath}_disc.txt")) - missingFiles.Add($"{basePath}_disc.txt"); - if (!File.Exists($"{basePath}_drive.txt")) - missingFiles.Add($"{basePath}_drive.txt"); - if (!File.Exists($"{basePath}_img.cue")) - missingFiles.Add($"{basePath}_img.cue"); - if (!File.Exists($"{basePath}_mainError.txt")) - missingFiles.Add($"{basePath}_mainError.txt"); - if (!File.Exists($"{basePath}_mainInfo.txt")) - missingFiles.Add($"{basePath}_mainInfo.txt"); - if (!File.Exists($"{basePath}_subError.txt")) - missingFiles.Add($"{basePath}_subError.txt"); - if (!File.Exists($"{basePath}_subInfo.txt")) - missingFiles.Add($"{basePath}_subInfo.txt"); - if (!File.Exists($"{basePath}_subReadable.txt") && !File.Exists($"{basePath}_sub.txt")) - missingFiles.Add($"{basePath}_subReadable.txt"); - if (!File.Exists($"{basePath}_volDesc.txt")) - missingFiles.Add($"{basePath}_volDesc.txt"); - - // Audio-only discs don't output these files - if (!System.IsAudio()) - { - if (!File.Exists($"{basePath}.img_EdcEcc.txt") && !File.Exists($"{basePath}.img_EccEdc.txt")) - missingFiles.Add($"{basePath}.img_EdcEcc.txt"); - } - } - - // Removed or inconsistent files - //{ - // // Doesn't output on Linux - // if (!File.Exists($"{basePath}.c2")) - // missingFiles.Add($"{basePath}.c2"); - - // // Doesn't output on Linux - // if (!File.Exists($"{basePath}_c2Error.txt")) - // missingFiles.Add($"{basePath}_c2Error.txt"); - - // // Replaced by timestamp-named file - // if (!File.Exists($"{basePath}_cmd.txt")) - // missingFiles.Add($"{basePath}_cmd.txt"); - - // // Not guaranteed output - // if (!File.Exists($"{basePath}_subIntention.txt")) - // missingFiles.Add($"{basePath}_subIntention.txt"); - - // // Not guaranteed output - // if (File.Exists($"{basePath}_suppl.dat")) - // missingFiles.Add($"{basePath}_suppl.dat"); - - // // Not guaranteed output (at least PCE) - // if (!File.Exists($"{basePath}.toc")) - // missingFiles.Add($"{basePath}.toc"); - //} - - break; - - case MediaType.DVD: - case MediaType.HDDVD: - case MediaType.BluRay: - case MediaType.NintendoGameCubeGameDisc: - case MediaType.NintendoWiiOpticalDisc: - if (!File.Exists($"{basePath}_logs.zip") || !preCheck) - { - if (!File.Exists($"{basePath}.dat")) - missingFiles.Add($"{basePath}.dat"); - if (!File.Exists($"{basePath}_disc.txt")) - missingFiles.Add($"{basePath}_disc.txt"); - if (!File.Exists($"{basePath}_drive.txt")) - missingFiles.Add($"{basePath}_drive.txt"); - if (!File.Exists($"{basePath}_mainError.txt")) - missingFiles.Add($"{basePath}_mainError.txt"); - if (!File.Exists($"{basePath}_mainInfo.txt")) - missingFiles.Add($"{basePath}_mainInfo.txt"); - if (!File.Exists($"{basePath}_volDesc.txt")) - missingFiles.Add($"{basePath}_volDesc.txt"); - } - - // Removed or inconsistent files - //{ - // // Replaced by timestamp-named file - // if (!File.Exists($"{basePath}_cmd.txt")) - // missingFiles.Add($"{basePath}_cmd.txt"); - - // // Not guaranteed output - // if (File.Exists($"{basePath}_CSSKey.txt")) - // missingFiles.Add($"{basePath}_CSSKey.txt"); - - // // Only output for some parameters - // if (File.Exists($"{basePath}.raw")) - // missingFiles.Add($"{basePath}.raw"); - - // // Not guaranteed output - // if (File.Exists($"{basePath}_suppl.dat")) - // missingFiles.Add($"{basePath}_suppl.dat"); - //} - - break; - - case MediaType.FloppyDisk: - case MediaType.HardDisk: - // TODO: Determine what outputs come out from a HDD, SD, etc. - if (!File.Exists($"{basePath}_logs.zip") || !preCheck) - { - if (!File.Exists($"{basePath}.dat")) - missingFiles.Add($"{basePath}.dat"); - if (!File.Exists($"{basePath}_disc.txt")) - missingFiles.Add($"{basePath}_disc.txt"); - } - - // Removed or inconsistent files - //{ - // // Replaced by timestamp-named file - // if (!File.Exists($"{basePath}_cmd.txt")) - // missingFiles.Add($"{basePath}_cmd.txt"); - //} - - break; - - default: - missingFiles.Add("Media and system combination not supported for DiscImageCreator"); - break; + allFound = false; + missingFiles.Add($"{basePath}_cmd.txt"); } - return (!missingFiles.Any(), missingFiles); + return (allFound, missingFiles); } /// diff --git a/MPF.Processors/PS3CFW.cs b/MPF.Processors/PS3CFW.cs index 8fbf741f..d806f039 100644 --- a/MPF.Processors/PS3CFW.cs +++ b/MPF.Processors/PS3CFW.cs @@ -18,36 +18,6 @@ namespace MPF.Processors #region BaseProcessor Implementations - /// - public override (bool, List) CheckAllOutputFilesExist(string basePath, bool preCheck) - { - // Get the base filename and directory from the base path - string baseFilename = Path.GetFileName(basePath); - string baseDirectory = Path.GetDirectoryName(basePath) ?? string.Empty; - - // Get the list of output files - var outputFiles = GetOutputFiles(baseFilename); - if (outputFiles.Count == 0) - return (false, ["Media and system combination not supported for PS3 CFW"]); - - var missingFiles = new List(); - - if (Type != MediaType.BluRay || System != RedumpSystem.SonyPlayStation3) - { - missingFiles.Add("Media and system combination not supported for PS3 CFW"); - } - else - { - string? getKeyBasePath = GetCFWBasePath(basePath); - if (!File.Exists($"{getKeyBasePath}.getkey.log")) - missingFiles.Add($"{getKeyBasePath}.getkey.log"); - if (!File.Exists($"{getKeyBasePath}.disc.pic")) - missingFiles.Add($"{getKeyBasePath}.disc.pic"); - } - - return (missingFiles.Count == 0, missingFiles); - } - /// public override void GenerateSubmissionInfo(SubmissionInfo info, string basePath, bool redumpCompat) { diff --git a/MPF.Processors/Redumper.cs b/MPF.Processors/Redumper.cs index 6246633d..668b63d3 100644 --- a/MPF.Processors/Redumper.cs +++ b/MPF.Processors/Redumper.cs @@ -20,130 +20,6 @@ namespace MPF.Processors #region BaseProcessor Implementations - /// - public override (bool, List) CheckAllOutputFilesExist(string basePath, bool preCheck) - { - // Get the base filename and directory from the base path - string baseFilename = Path.GetFileName(basePath); - string baseDirectory = Path.GetDirectoryName(basePath) ?? string.Empty; - - // Get the list of output files - var outputFiles = GetOutputFiles(baseFilename); - if (outputFiles.Count == 0) - return (false, ["Media and system combination not supported for Redumper"]); - - var missingFiles = new List(); - - switch (Type) - { - case MediaType.CDROM: - 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}_logs.zip") || !preCheck) - { - if (!File.Exists($"{basePath}.fulltoc")) - missingFiles.Add($"{basePath}.fulltoc"); - if (!File.Exists($"{basePath}.log")) - missingFiles.Add($"{basePath}.log"); - else if (GetDatfile($"{basePath}.log") == null) - missingFiles.Add($"{basePath}.log (dat section)"); - 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 - //{ - // // Depends on the disc - // if (!File.Exists($"{basePath}.cdtext")) - // missingFiles.Add($"{basePath}.cdtext"); - // - // // Not available in all versions - // if (!File.Exists($"{basePath}.asus")) - // missingFiles.Add($"{basePath}.asus"); - // if (!File.Exists($"{basePath}.atip")) - // missingFiles.Add($"{basePath}.atip"); - // if (!File.Exists($"{basePath}.hash")) - // missingFiles.Add($"{basePath}.hash"); - // // Also: "{basePath} (Track X).hash" (get from cuesheet) - // if (!File.Exists($"{basePath}.pma")) - // missingFiles.Add($"{basePath}.pma"); - // if (!File.Exists($"{basePath}.skeleton")) - // missingFiles.Add($"{basePath}.skeleton"); - // // Also: "{basePath} (Track X).skeleton" (get from cuesheet) - //} - - break; - - case MediaType.DVD: - if (!File.Exists($"{basePath}_logs.zip") || !preCheck) - { - if (!File.Exists($"{basePath}.log")) - missingFiles.Add($"{basePath}.log"); - else if (GetDatfile($"{basePath}.log") == null) - missingFiles.Add($"{basePath}.dat"); - if (!File.Exists($"{basePath}.manufacturer") && !File.Exists($"{basePath}.1.manufacturer") && !File.Exists($"{basePath}.2.manufacturer")) - missingFiles.Add($"{basePath}.manufacturer"); - if (!File.Exists($"{basePath}.physical") && !File.Exists($"{basePath}.0.physical") && !File.Exists($"{basePath}.1.physical") && !File.Exists($"{basePath}.2.physical")) - missingFiles.Add($"{basePath}.physical"); - if (!File.Exists($"{basePath}.state")) - missingFiles.Add($"{basePath}.state"); - } - - // Removed or inconsistent files - //{ - // // Not available in all versions - // if (!File.Exists($"{basePath}.asus")) - // missingFiles.Add($"{basePath}.asus"); - // if (!File.Exists($"{basePath}.hash")) - // missingFiles.Add($"{basePath}.hash"); - // if (!File.Exists($"{basePath}.skeleton")) - // missingFiles.Add($"{basePath}.skeleton"); - //} - - break; - - case MediaType.HDDVD: // TODO: Verify that this is output - case MediaType.BluRay: - if (!File.Exists($"{basePath}_logs.zip") || !preCheck) - { - if (!File.Exists($"{basePath}.log")) - missingFiles.Add($"{basePath}.log"); - else if (GetDatfile($"{basePath}.log") == null) - missingFiles.Add($"{basePath}.dat"); - if (!File.Exists($"{basePath}.physical") && !File.Exists($"{basePath}.0.physical") && !File.Exists($"{basePath}.1.physical") && !File.Exists($"{basePath}.2.physical")) - missingFiles.Add($"{basePath}.physical"); - if (!File.Exists($"{basePath}.state")) - missingFiles.Add($"{basePath}.state"); - } - - // Removed or inconsistent files - //{ - // // Not available in all versions - // if (!File.Exists($"{basePath}.asus")) - // missingFiles.Add($"{basePath}.asus"); - // if (!File.Exists($"{basePath}.hash")) - // missingFiles.Add($"{basePath}.hash"); - // if (!File.Exists($"{basePath}.skeleton")) - // missingFiles.Add($"{basePath}.skeleton"); - //} - - break; - - default: - missingFiles.Add("Media and system combination not supported for Redumper"); - break; - } - - return (!missingFiles.Any(), missingFiles); - } - /// public override void GenerateSubmissionInfo(SubmissionInfo info, string basePath, bool redumpCompat) { diff --git a/MPF.Processors/UmdImageCreator.cs b/MPF.Processors/UmdImageCreator.cs index ee990be2..fbb158c7 100644 --- a/MPF.Processors/UmdImageCreator.cs +++ b/MPF.Processors/UmdImageCreator.cs @@ -19,44 +19,6 @@ namespace MPF.Processors #region BaseProcessor Implementations - /// - public override (bool, List) CheckAllOutputFilesExist(string basePath, bool preCheck) - { - // Get the base filename and directory from the base path - string baseFilename = Path.GetFileName(basePath); - string baseDirectory = Path.GetDirectoryName(basePath) ?? string.Empty; - - // Get the list of output files - var outputFiles = GetOutputFiles(baseFilename); - if (outputFiles.Count == 0) - return (false, ["Media and system combination not supported for UmdImageCreator"]); - - var missingFiles = new List(); - switch (Type) - { - case MediaType.UMD: - if (!File.Exists($"{basePath}_logs.zip") || !preCheck) - { - if (!File.Exists($"{basePath}_disc.txt")) - missingFiles.Add($"{basePath}_disc.txt"); - if (!File.Exists($"{basePath}_mainError.txt")) - missingFiles.Add($"{basePath}_mainError.txt"); - if (!File.Exists($"{basePath}_mainInfo.txt")) - missingFiles.Add($"{basePath}_mainInfo.txt"); - if (!File.Exists($"{basePath}_volDesc.txt")) - missingFiles.Add($"{basePath}_volDesc.txt"); - } - - break; - - default: - missingFiles.Add("Media and system combination not supported for UmdImageCreator"); - break; - } - - return (!missingFiles.Any(), missingFiles); - } - /// public override void GenerateSubmissionInfo(SubmissionInfo info, string basePath, bool redumpCompat) { diff --git a/MPF.Processors/XboxBackupCreator.cs b/MPF.Processors/XboxBackupCreator.cs index 6caf6f3b..e8d7c8cb 100644 --- a/MPF.Processors/XboxBackupCreator.cs +++ b/MPF.Processors/XboxBackupCreator.cs @@ -18,53 +18,6 @@ namespace MPF.Processors #region BaseProcessor Implementations - /// - public override (bool, List) CheckAllOutputFilesExist(string basePath, bool preCheck) - { - // Get the base filename and directory from the base path - string baseFilename = Path.GetFileName(basePath); - string baseDirectory = Path.GetDirectoryName(basePath) ?? string.Empty; - - // Get the list of output files - var outputFiles = GetOutputFiles(baseFilename); - if (outputFiles.Count == 0) - return (false, ["Media and system combination not supported for XboxBackupCreator"]); - - var missingFiles = new List(); - switch (Type) - { - case MediaType.DVD: - if (!File.Exists($"{basePath}_logs.zip") || !preCheck) - { - string? logPath = GetLogName(baseDirectory); - if (string.IsNullOrEmpty(logPath)) - missingFiles.Add(Path.Combine(baseDirectory, "Log.txt")); - if (!File.Exists(Path.Combine(baseDirectory, "DMI.bin"))) - missingFiles.Add(Path.Combine(baseDirectory, "DMI.bin")); - if (!File.Exists(Path.Combine(baseDirectory, "PFI.bin"))) - missingFiles.Add(Path.Combine(baseDirectory, "PFI.bin")); - if (!File.Exists(Path.Combine(baseDirectory, "SS.bin"))) - missingFiles.Add(Path.Combine(baseDirectory, "SS.bin")); - - // Not required from XBC - //if (!File.Exists($"{basePath}.dvd")) - // missingFiles.Add($"{basePath}.dvd"); - } - else - { - - } - - break; - - default: - missingFiles.Add("Media and system combination not supported for XboxBackupCreator"); - break; - } - - return (!missingFiles.Any(), missingFiles); - } - /// public override void GenerateSubmissionInfo(SubmissionInfo info, string basePath, bool redumpCompat) {