Fix import and generation by fixing how game names and file names are processed and stored.

This commit is contained in:
Matt Nadareski
2016-03-18 19:19:01 -07:00
parent 90ea3ba25d
commit c16f1ac3ca
2 changed files with 5 additions and 6 deletions

View File

@@ -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"))) +

View File

@@ -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")
{