Fix multiple DiscType* for DIC

This commit is contained in:
Matt Nadareski
2022-10-20 12:17:05 -07:00
parent c391dbd3c8
commit 6cc2351bf7
2 changed files with 24 additions and 5 deletions

View File

@@ -164,6 +164,7 @@
- Add framework for reported disc type
- Add disc type parsing for Aaru and DIC
- Fix multiple DiscType for DIC
- Fix multiple DiscType* for DIC
### 2.3 (2022-02-05)
- Start overhauling Redump information pulling, again

View File

@@ -2586,8 +2586,8 @@ namespace MPF.Modules.DiscImageCreator
// Trim the line for later use
line = line.Trim();
if (line.StartsWith("DiscType"))
// Concatenate all found values for each possible line type
if (line.StartsWith("DiscType:"))
{
// DiscType: <discType>
if (string.IsNullOrEmpty(discTypeOrBookType))
@@ -2595,11 +2595,29 @@ namespace MPF.Modules.DiscImageCreator
else
discTypeOrBookType += $", {line.Substring("DiscType: ".Length)}";
}
// Only take the first instance for anything that's not a CD
else if (string.IsNullOrEmpty(discTypeOrBookType) && line.StartsWith("BookType"))
else if (line.StartsWith("DiscTypeIdentifier:"))
{
// DiscType: <discType>
if (string.IsNullOrEmpty(discTypeOrBookType))
discTypeOrBookType = line.Substring("DiscTypeIdentifier: ".Length);
else
discTypeOrBookType += $", {line.Substring("DiscTypeIdentifier: ".Length)}";
}
else if (line.StartsWith("DiscTypeSpecific:"))
{
// DiscType: <discType>
if (string.IsNullOrEmpty(discTypeOrBookType))
discTypeOrBookType = line.Substring("DiscTypeSpecific: ".Length);
else
discTypeOrBookType += $", {line.Substring("DiscTypeSpecific: ".Length)}";
}
else if (line.StartsWith("BookType:"))
{
// BookType: <discType>
discTypeOrBookType = line.Substring("BookType: ".Length);
if (string.IsNullOrEmpty(discTypeOrBookType))
discTypeOrBookType = line.Substring("BookType: ".Length);
else
discTypeOrBookType += $", {line.Substring("BookType: ".Length)}";
}
line = sr.ReadLine();