diff --git a/DATabase/DATabase.csproj b/DATabase/DATabase.csproj index 36b77b3e..f9766ac7 100644 --- a/DATabase/DATabase.csproj +++ b/DATabase/DATabase.csproj @@ -84,6 +84,9 @@ Always + + Always + Always diff --git a/DATabase/Import.cs b/DATabase/Import.cs index 54b0248a..47218c00 100644 --- a/DATabase/Import.cs +++ b/DATabase/Import.cs @@ -21,6 +21,7 @@ namespace SabreTools // Regex File Name Patterns private static string _defaultPattern = @"^(.+?) - (.+?) \((.*) (.*)\)\.dat$"; private static string _mamePattern = @"^(.*)\.xml$"; + private static string _maybeIntroPattern = @"(.*?) \[T-En\].*\((\d{8})\)\.dat$"; private static string _noIntroPattern = @"^(.*?) \((\d{8}-\d{6})_CM\)\.dat$"; private static string _noIntroNumberedPattern = @"(.*? - .*?) \(\d.*?_CM\).dat"; private static string _noIntroSpecialPattern = @"(.*? - .*?) \((\d{8})\)\.dat"; @@ -56,6 +57,7 @@ namespace SabreTools TOSEC, TruRip, NonGood, + MaybeIntro, } // Public instance variables @@ -101,6 +103,11 @@ namespace SabreTools fileinfo = Regex.Match(filename, _mamePattern).Groups; type = DatType.MAME; } + else if (Regex.IsMatch(filename, _maybeIntroPattern)) + { + fileinfo = Regex.Match(filename, _maybeIntroPattern).Groups; + type = DatType.MaybeIntro; + } else if (Regex.IsMatch(filename, _noIntroPattern)) { fileinfo = Regex.Match(filename, _noIntroPattern).Groups; @@ -186,6 +193,21 @@ namespace SabreTools source = "MAME"; date = File.GetLastWriteTime(_filepath).ToString("yyyy-MM-dd HH:mm:ss"); break; + case DatType.MaybeIntro: + if (!Remapping.MaybeIntro.ContainsKey(fileinfo[1].Value)) + { + _logger.Error("The filename " + fileinfo[1].Value + " could not be mapped! Please check the mappings and try again"); + return false; + } + GroupCollection maybeIntroInfo = Regex.Match(Remapping.MaybeIntro[fileinfo[1].Value], _remappedPattern).Groups; + + manufacturer = maybeIntroInfo[1].Value; + system = maybeIntroInfo[2].Value; + source = "Maybe-Intro"; + datestring = fileinfo[2].Value; + GroupCollection miDateInfo = Regex.Match(datestring, _noIntroSpecialDatePattern).Groups; + date = miDateInfo[1].Value + "-" + miDateInfo[2].Value + "-" + miDateInfo[3].Value + " 00:00:00"; + break; case DatType.NoIntro: if (!Remapping.NoIntro.ContainsKey(fileinfo[1].Value)) { diff --git a/DATabase/Mappings/MaybeIntro.xml b/DATabase/Mappings/MaybeIntro.xml new file mode 100644 index 00000000..b634be3d --- /dev/null +++ b/DATabase/Mappings/MaybeIntro.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/SabreHelper/Remapping.cs b/SabreHelper/Remapping.cs index 5ef78914..43363c68 100644 --- a/SabreHelper/Remapping.cs +++ b/SabreHelper/Remapping.cs @@ -12,6 +12,7 @@ namespace SabreTools.Helper { // Remapping classes represented by dictionaries public static Dictionary MAME = new Dictionary(); + public static Dictionary MaybeIntro = new Dictionary(); public static Dictionary NoIntro = new Dictionary(); public static Dictionary NonGood = new Dictionary(); public static Dictionary Redump = new Dictionary(); @@ -26,7 +27,7 @@ namespace SabreTools.Helper // Create array of dictionary names string[] remappings = { - "MAME", "NoIntro", "NonGood", "Redump", "TOSEC", "TruRip", + "MAME", "MaybeIntro", "NoIntro", "NonGood", "Redump", "TOSEC", "TruRip", }; // Loop through and add all remappings @@ -76,6 +77,9 @@ namespace SabreTools.Helper case "MAME": MAME.Add(node.Attributes["from"].Value, node.Attributes["to"].Value); break; + case "MaybeIntro": + MaybeIntro.Add(node.Attributes["from"].Value, node.Attributes["to"].Value); + break; case "NoIntro": NoIntro.Add(node.Attributes["from"].Value, node.Attributes["to"].Value); break;