Retrieve serial from Cleanrip (fixes #643)

This commit is contained in:
Matt Nadareski
2024-02-01 11:05:42 -05:00
parent c22d16349a
commit 35dec7fe57
2 changed files with 7 additions and 4 deletions

View File

@@ -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)

View File

@@ -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
/// <param name="region">Output region, if possible</param>
/// <param name="version">Output internal version of the game</param>
/// <param name="name">Output internal name of the game</param>
/// <param name="serial">Output internal serial of the game</param>
/// <returns></returns>
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];