From 3491968519b43ede83770af5d9258455f6a839bf Mon Sep 17 00:00:00 2001 From: Michael Green <84688932+michael-j-green@users.noreply.github.com> Date: Tue, 21 Feb 2023 23:07:07 +1100 Subject: [PATCH] =?UTF-8?q?fix:=20fixed=20parsing=20of=20=E2=80=9Ca?= =?UTF-8?q?=E2=80=9D=20dump=20flag?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gaseous-identifier/Classes/TosecParser.cs | 68 +++++++++++-------- .../Objects/RomSignatureObject.cs | 5 ++ 2 files changed, 43 insertions(+), 30 deletions(-) diff --git a/gaseous-identifier/Classes/TosecParser.cs b/gaseous-identifier/Classes/TosecParser.cs index 7b575c7..b4e1a9c 100644 --- a/gaseous-identifier/Classes/TosecParser.cs +++ b/gaseous-identifier/Classes/TosecParser.cs @@ -434,37 +434,45 @@ namespace gaseous_identifier.classes if (dToken.Length > 0) { string[] dTokenCompare = dToken.Split(" "); - switch (dTokenCompare[0].Trim().ToLower()) + if (dTokenCompare[0].Trim().ToLower().StartsWith("a")) { - case "cr": - // cracked - case "f": - // fixed - case "h": - // hacked - case "m": - // modified - case "p": - // pirated - case "t": - // trained - case "tr": - // translated - case "o": - // overdump - case "u": - // underdump - case "v": - // virus - case "b": - // bad dump - case "a": - // alternate - case "!": - // known verified dump - // ------------------- - romObject.flags.Add(dToken); - break; + romObject.flags.Add(dTokenCompare[0].Trim()); + } + else + { + + switch (dTokenCompare[0].Trim().ToLower()) + { + case "cr": + // cracked + case "f": + // fixed + case "h": + // hacked + case "m": + // modified + case "p": + // pirated + case "t": + // trained + case "tr": + // translated + case "o": + // overdump + case "u": + // underdump + case "v": + // virus + case "b": + // bad dump + case "a": + // alternate + case "!": + // known verified dump + // ------------------- + romObject.flags.Add(dToken); + break; + } } } diff --git a/gaseous-identifier/Objects/RomSignatureObject.cs b/gaseous-identifier/Objects/RomSignatureObject.cs index 4aa7c9e..6ad3ae7 100644 --- a/gaseous-identifier/Objects/RomSignatureObject.cs +++ b/gaseous-identifier/Objects/RomSignatureObject.cs @@ -38,6 +38,11 @@ namespace gaseous_identifier.objects public string? Language { get; set; } public string? Copyright { get; set; } public List Roms { get; set; } = new List(); + public int RomCount { get + { + return Roms.Count(); + } + } public enum DemoTypes {