mirror of
https://github.com/SabreTools/MPF.git
synced 2026-07-02 17:24:48 +00:00
Use simplified CheckAllOutputFilesExist
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
@@ -27,67 +27,6 @@ namespace MPF.Processors
|
||||
|
||||
#region BaseProcessor Implementations
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override (bool, List<string>) 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<string>();
|
||||
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);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override void GenerateSubmissionInfo(SubmissionInfo info, string basePath, bool redumpCompat)
|
||||
{
|
||||
|
||||
@@ -50,7 +50,8 @@ namespace MPF.Processors
|
||||
/// <param name="basePath">Base filename and path to use for checking</param>
|
||||
/// <param name="preCheck">True if this is a check done before a dump, false if done after</param>
|
||||
/// <returns>Tuple of true if all required files exist, false otherwise and a list representing missing files</returns>
|
||||
public abstract (bool, List<string>) CheckAllOutputFilesExist(string basePath, bool preCheck);
|
||||
public virtual (bool, List<string>) CheckAllOutputFilesExist(string basePath, bool preCheck)
|
||||
=> CheckRequiredFiles(basePath);
|
||||
|
||||
/// <summary>
|
||||
/// Generate a SubmissionInfo for the output files
|
||||
@@ -250,78 +251,6 @@ namespace MPF.Processors
|
||||
return artifacts;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Validate if all required output files exist
|
||||
/// </summary>
|
||||
/// <param name="basePath">Base filename and path to use for checking</param>
|
||||
/// <returns>Tuple of true if all required files exist, false otherwise and a list representing missing files</returns>
|
||||
protected (bool, List<string>) 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<string>();
|
||||
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
|
||||
/// <summary>
|
||||
/// Try to add a set of files to an existing archive
|
||||
@@ -393,6 +322,78 @@ namespace MPF.Processors
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Validate if all required output files exist
|
||||
/// </summary>
|
||||
/// <param name="basePath">Base filename and path to use for checking</param>
|
||||
/// <returns>Tuple of true if all required files exist, false otherwise and a list representing missing files</returns>
|
||||
private (bool, List<string>) 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<string>();
|
||||
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);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Generate a list of all deleteable filenames
|
||||
/// </summary>
|
||||
|
||||
@@ -19,42 +19,6 @@ namespace MPF.Processors
|
||||
|
||||
#region BaseProcessor Implementations
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override (bool, List<string>) 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<string>();
|
||||
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);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override void GenerateSubmissionInfo(SubmissionInfo info, string basePath, bool redumpCompat)
|
||||
{
|
||||
|
||||
@@ -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<string> 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<string>();
|
||||
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);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
|
||||
@@ -18,36 +18,6 @@ namespace MPF.Processors
|
||||
|
||||
#region BaseProcessor Implementations
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override (bool, List<string>) 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<string>();
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override void GenerateSubmissionInfo(SubmissionInfo info, string basePath, bool redumpCompat)
|
||||
{
|
||||
|
||||
@@ -20,130 +20,6 @@ namespace MPF.Processors
|
||||
|
||||
#region BaseProcessor Implementations
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override (bool, List<string>) 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<string>();
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override void GenerateSubmissionInfo(SubmissionInfo info, string basePath, bool redumpCompat)
|
||||
{
|
||||
|
||||
@@ -19,44 +19,6 @@ namespace MPF.Processors
|
||||
|
||||
#region BaseProcessor Implementations
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override (bool, List<string>) 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<string>();
|
||||
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);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override void GenerateSubmissionInfo(SubmissionInfo info, string basePath, bool redumpCompat)
|
||||
{
|
||||
|
||||
@@ -18,53 +18,6 @@ namespace MPF.Processors
|
||||
|
||||
#region BaseProcessor Implementations
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override (bool, List<string>) 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<string>();
|
||||
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);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override void GenerateSubmissionInfo(SubmissionInfo info, string basePath, bool redumpCompat)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user