diff --git a/DATabase/Generate.cs b/DATabase/Generate.cs index c8c44152..86715472 100644 --- a/DATabase/Generate.cs +++ b/DATabase/Generate.cs @@ -300,7 +300,7 @@ JOIN checksums // If the name and set are the same, rename it with whatever is different if (samename && samegame) { - temp.Name = Regex.Replace(temp.Name, @"^(.*)(\..*)", "$1 (" + + temp.Name = Regex.Replace(temp.Name, @"^(.*)(\..*)", "$1(" + (temp.CRC != "" ? temp.CRC : (temp.MD5 != "" ? temp.MD5 : (temp.SHA1 != "" ? temp.SHA1 : "Alt"))) + diff --git a/DATabase/Importer.cs b/DATabase/Importer.cs index a63a57d1..bf6723b6 100644 --- a/DATabase/Importer.cs +++ b/DATabase/Importer.cs @@ -514,14 +514,13 @@ namespace DATabase private bool AddRomHelper(string machinename, string romtype, long gameid, string name, string date, int size, string crc, string md5, string sha1) { + // WOD origninally stripped out any subdirs from the imported files, we do the same + name = Path.GetFileName(name); + // Run the name through the filters to make sure that it's correct name = Style.NormalizeChars(name); name = Style.RussianToLatin(name); - name = Style.SearchPattern(name); - - // WOD origninally stripped out any subdirs from the imported files, we do the same - string[] fullname = name.Split('\\'); - name = fullname[fullname.Length - 1]; + name = Regex.Replace(name, @"(.*) \.(.*)", "$1.$2"); if (romtype != "rom" && romtype != "disk") {