diff --git a/FriishProduce/FriishProduce.csproj b/FriishProduce/FriishProduce.csproj index 599280a3..dbfbe5dc 100644 --- a/FriishProduce/FriishProduce.csproj +++ b/FriishProduce/FriishProduce.csproj @@ -46,7 +46,7 @@ AnyCPU pdbonly - true + false bin\Release\ TRACE prompt diff --git a/FriishProduce/_classes/Databases/LibRetro.cs b/FriishProduce/_classes/Databases/LibRetro.cs index 3d7a2042..2724262c 100644 --- a/FriishProduce/_classes/Databases/LibRetro.cs +++ b/FriishProduce/_classes/Databases/LibRetro.cs @@ -195,22 +195,11 @@ public static DataTable Parse(Platform In) // Scan retrieved database for CRC32 hashes, and add to data table // **************** - for (int i = db_lines[0].Length - 1; i > 1; i--) + for (int i = 0; i < db_lines[0].Length; i++) { string line = db_lines[0][i]; - if (line.Contains("crc ")) - { - if (dt.Select($"crc = '{crc}'")?.Length == 0 && !string.IsNullOrWhiteSpace(name)) - { - dt.Rows.Add(crc, name, null, releaseyear, users, image); - image = users = releaseyear = name = crc = null; - } - - crc = db_crc(line.Substring(line.IndexOf("crc ") + 4, 8)); - } - - if (string.IsNullOrEmpty(name) && (line.Contains("name \"") || line.Contains("comment \"")) && !line.Contains("rom (")) + if (string.IsNullOrEmpty(name) && (line.Contains("name \"") || line.Contains("comment \"")) && !line.Contains("rom (") && !line.Contains(db_name)) { name = line.Replace("\t", "").Replace("name \"", "").Replace("comment \"", "").Replace("\"", ""); image = db_img(name); @@ -230,6 +219,17 @@ public static DataTable Parse(Platform In) { serial = line.Substring(line.IndexOf("serial ") + 7).TrimStart('\"', ' ', '\t', ')').TrimEnd('\"', ' ', '\t', ')'); } + + if (line.Contains("crc ")) + { + crc = db_crc(line.Substring(line.IndexOf("crc ") + 4, 8)); + + if (dt.Select($"crc = '{crc}'")?.Length == 0 && !string.IsNullOrWhiteSpace(name)) + { + dt.Rows.Add(crc, name, serial, releaseyear, users, image); + image = users = releaseyear = name = crc = null; + } + } } // Add release year, players and others