Add special mappings for TRS Model 2-4

This commit is contained in:
Matt Nadareski
2016-03-30 12:52:35 -07:00
parent 3e7e5eac7f
commit 397ef8067a

View File

@@ -49,6 +49,7 @@ namespace SabreTools
private static string _nointroPattern = @"^(.*?) \((\d{8}-\d{6})_CM\)\.dat$"; private static string _nointroPattern = @"^(.*?) \((\d{8}-\d{6})_CM\)\.dat$";
private static string _redumpPattern = @"^(.*?) \((\d{8} \d{2}-\d{2}-\d{2})\)\.dat$"; private static string _redumpPattern = @"^(.*?) \((\d{8} \d{2}-\d{2}-\d{2})\)\.dat$";
private static string _tosecPattern = @"^(.*?) - .* \(TOSEC-v(\d{4}-\d{2}-\d{2})_CM\)\.dat$"; private static string _tosecPattern = @"^(.*?) - .* \(TOSEC-v(\d{4}-\d{2}-\d{2})_CM\)\.dat$";
private static string _tosecSpecialPattern = @"^(.*? - .*? - .*?) - .* \(TOSEC-v(\d{4}-\d{2}-\d{2})_CM\)\.dat$";
private static string _truripPattern = @"^(.*?) - .* \(trurip_XML\)\.dat$"; private static string _truripPattern = @"^(.*?) - .* \(trurip_XML\)\.dat$";
// Regex Mapped Name Patterns // Regex Mapped Name Patterns
@@ -204,11 +205,17 @@ namespace SabreTools
rdDateInfo[4].Value + ":" + rdDateInfo[5].Value + ":" + rdDateInfo[6].Value; rdDateInfo[4].Value + ":" + rdDateInfo[5].Value + ":" + rdDateInfo[6].Value;
break; break;
case DatType.TOSEC: case DatType.TOSEC:
if (!Remapping.TOSEC.ContainsKey(fileinfo[1].Value))
{
// Handle special case mappings found only in TOSEC
fileinfo = Regex.Match(filename, _tosecSpecialPattern).Groups;
if (!Remapping.TOSEC.ContainsKey(fileinfo[1].Value)) if (!Remapping.TOSEC.ContainsKey(fileinfo[1].Value))
{ {
_logger.Log("The filename " + fileinfo[1].Value + " could not be mapped! Please check the mappings and try again"); _logger.Log("The filename " + fileinfo[1].Value + " could not be mapped! Please check the mappings and try again");
return false; return false;
} }
}
GroupCollection tosecInfo = Regex.Match(Remapping.TOSEC[fileinfo[1].Value], _remappedPattern).Groups; GroupCollection tosecInfo = Regex.Match(Remapping.TOSEC[fileinfo[1].Value], _remappedPattern).Groups;
manufacturer = tosecInfo[1].Value; manufacturer = tosecInfo[1].Value;