diff --git a/CHANGELIST.md b/CHANGELIST.md index a41b1296..b1532a39 100644 --- a/CHANGELIST.md +++ b/CHANGELIST.md @@ -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 diff --git a/MPF.Modules/DiscImageCreator/Parameters.cs b/MPF.Modules/DiscImageCreator/Parameters.cs index 9c895dfa..c0fa21f9 100644 --- a/MPF.Modules/DiscImageCreator/Parameters.cs +++ b/MPF.Modules/DiscImageCreator/Parameters.cs @@ -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: 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: + if (string.IsNullOrEmpty(discTypeOrBookType)) + discTypeOrBookType = line.Substring("DiscTypeIdentifier: ".Length); + else + discTypeOrBookType += $", {line.Substring("DiscTypeIdentifier: ".Length)}"; + } + else if (line.StartsWith("DiscTypeSpecific:")) + { + // DiscType: + if (string.IsNullOrEmpty(discTypeOrBookType)) + discTypeOrBookType = line.Substring("DiscTypeSpecific: ".Length); + else + discTypeOrBookType += $", {line.Substring("DiscTypeSpecific: ".Length)}"; + } + else if (line.StartsWith("BookType:")) { // BookType: - discTypeOrBookType = line.Substring("BookType: ".Length); + if (string.IsNullOrEmpty(discTypeOrBookType)) + discTypeOrBookType = line.Substring("BookType: ".Length); + else + discTypeOrBookType += $", {line.Substring("BookType: ".Length)}"; } line = sr.ReadLine();