From e483e1cdc6b0fa913761e2b7ccffb986fc10b32a Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Sat, 10 Jun 2023 12:03:14 -0400 Subject: [PATCH] Unblock Redumper DVD support --- CHANGELIST.md | 1 + MPF.Modules/Redumper/Parameters.cs | 46 ++++++++++++++++++++++++++++-- 2 files changed, 45 insertions(+), 2 deletions(-) diff --git a/CHANGELIST.md b/CHANGELIST.md index 9221f712..0bff0e43 100644 --- a/CHANGELIST.md +++ b/CHANGELIST.md @@ -59,6 +59,7 @@ - Fix MCD region(s) parsing - Update to DIC 20230606 - Update redumper to build 166 +- Unblock Redumper DVD support ### 2.5 (2023-03-12) diff --git a/MPF.Modules/Redumper/Parameters.cs b/MPF.Modules/Redumper/Parameters.cs index 7b5bfe68..6edbe68f 100644 --- a/MPF.Modules/Redumper/Parameters.cs +++ b/MPF.Modules/Redumper/Parameters.cs @@ -214,6 +214,21 @@ namespace MPF.Modules.Redumper break; + case MediaType.DVD: + if (!File.Exists($"{basePath}_logs.zip") || !preCheck) + { + if (!File.Exists($"{basePath}.log")) + missingFiles.Add($"{basePath}.log"); + if (!File.Exists($"{basePath}.manufacturer")) + missingFiles.Add($"{basePath}.manufacturer"); + if (!File.Exists($"{basePath}.physical")) + missingFiles.Add($"{basePath}.physical"); + if (!File.Exists($"{basePath}.state")) + missingFiles.Add($"{basePath}.state"); + } + + break; + default: missingFiles.Add("Media and system combination not supported for Redumper"); break; @@ -257,6 +272,22 @@ namespace MPF.Modules.Redumper info.CommonDiscInfo.CommentsSpecialFields[SiteCode.RingNonZeroDataStart] = ringNonZeroDataStart; break; + + case MediaType.DVD: + info.Extras.PVD = GetPVD($"{basePath}.log") ?? "Disc has no PVD"; ; + info.TracksAndWriteOffsets.ClrMameProData = GetDatfile($"{basePath}.log"); + + // Get the individual hash data, as per internal + if (GetISOHashValues(info.TracksAndWriteOffsets.ClrMameProData, out long size, out string crc32, out string md5, out string sha1)) + { + info.SizeAndChecksums.Size = size; + info.SizeAndChecksums.CRC32 = crc32; + info.SizeAndChecksums.MD5 = md5; + info.SizeAndChecksums.SHA1 = sha1; + } + + // TODO: Get layerbreak info + break; } switch (this.System) @@ -650,6 +681,17 @@ namespace MPF.Modules.Redumper if (File.Exists($"{basePath}.toc")) logFiles.Add($"{basePath}.toc"); break; + + case MediaType.DVD: + if (File.Exists($"{basePath}.log")) + logFiles.Add($"{basePath}.log"); + if (File.Exists($"{basePath}.manufacturer")) + logFiles.Add($"{basePath}.manufacturer"); + if (File.Exists($"{basePath}.physical")) + logFiles.Add($"{basePath}.physical"); + if (File.Exists($"{basePath}.state")) + logFiles.Add($"{basePath}.state"); + break; } return logFiles; @@ -702,8 +744,8 @@ namespace MPF.Modules.Redumper /// protected override void SetDefaultParameters(char driveLetter, string filename, int? driveSpeed, Options options) { - // If we don't have a CD, we can't dump using redumper - if (this.Type != MediaType.CDROM) + // If we don't have a CD or DVD, we can't dump using redumper + if (this.Type != MediaType.CDROM && this.Type != MediaType.DVD) return; BaseCommand = CommandStrings.NONE;