From 35dec7fe57c03538ed70c0b4a59d76089226aee2 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Thu, 1 Feb 2024 11:05:42 -0500 Subject: [PATCH] Retrieve serial from Cleanrip (fixes #643) --- CHANGELIST.md | 1 + MPF.Core/Modules/CleanRIp/Parameters.cs | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELIST.md b/CHANGELIST.md index 79f8e931..ee2d489d 100644 --- a/CHANGELIST.md +++ b/CHANGELIST.md @@ -25,6 +25,7 @@ - Parse PSX/PS2/KP2 exe date from logs (Deterous) - Exclude extra tracks when finding disc matches (Deterous) - Verbose Redumper log by default (Deterous) +- Retrieve serial from Cleanrip ### 3.0.3 (2023-12-04) diff --git a/MPF.Core/Modules/CleanRIp/Parameters.cs b/MPF.Core/Modules/CleanRIp/Parameters.cs index 26a5407c..5d4a4992 100644 --- a/MPF.Core/Modules/CleanRIp/Parameters.cs +++ b/MPF.Core/Modules/CleanRIp/Parameters.cs @@ -97,11 +97,12 @@ namespace MPF.Core.Modules.CleanRip if (File.Exists(basePath + ".bca")) info.Extras!.BCA = GetBCA(basePath + ".bca"); - if (GetGameCubeWiiInformation(basePath + "-dumpinfo.txt", out Region? gcRegion, out var gcVersion, out var gcName)) + if (GetGameCubeWiiInformation(basePath + "-dumpinfo.txt", out Region? gcRegion, out var gcVersion, out var gcName, out var gcSerial)) { info.CommonDiscInfo!.Region = gcRegion ?? info.CommonDiscInfo.Region; info.VersionAndEditions!.Version = gcVersion ?? info.VersionAndEditions.Version; info.CommonDiscInfo.CommentsSpecialFields![SiteCode.InternalName] = gcName ?? string.Empty; + info.CommonDiscInfo.CommentsSpecialFields![SiteCode.InternalSerialName] = gcSerial ?? string.Empty; } break; @@ -283,10 +284,11 @@ namespace MPF.Core.Modules.CleanRip /// Output region, if possible /// Output internal version of the game /// Output internal name of the game + /// Output internal serial of the game /// - private static bool GetGameCubeWiiInformation(string dumpinfo, out Region? region, out string? version, out string? name) + private static bool GetGameCubeWiiInformation(string dumpinfo, out Region? region, out string? version, out string? name, out string? serial) { - region = null; version = null; name = null; + region = null; version = null; name = null, serial = null; // If the file doesn't exist, we can't get info from it if (!File.Exists(dumpinfo)) @@ -317,7 +319,7 @@ namespace MPF.Core.Modules.CleanRip } else if (line.StartsWith("Filename")) { - string serial = line.Substring("Filename: ".Length); + serial = line.Substring("Filename: ".Length); // char gameType = serial[0]; // string gameid = serial[1] + serial[2];