mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Add better support for non-DOM No-Intro DATs
This commit is contained in:
@@ -47,7 +47,7 @@ namespace SabreTools
|
|||||||
// Regex File Name Patterns
|
// Regex File Name Patterns
|
||||||
private static string _defaultPattern = @"^(.+?) - (.+?) \((.*) (.*)\)\.dat$";
|
private static string _defaultPattern = @"^(.+?) - (.+?) \((.*) (.*)\)\.dat$";
|
||||||
private static string _mamePattern = @"^(.*)\.xml$";
|
private static string _mamePattern = @"^(.*)\.xml$";
|
||||||
private static string _nointroPattern = @"^(.*?) \((\d{8}-\d{6})_CM\)\.dat$";
|
private static string _noIntroPattern = @"^(.*?) \((\d{8}-\d{6})_CM\)\.dat$";
|
||||||
private static string _noIntroNumberedPattern = @"(.*? - .*?) \(.*?_CM\).dat";
|
private static string _noIntroNumberedPattern = @"(.*? - .*?) \(.*?_CM\).dat";
|
||||||
private static string _noIntroSpecialPattern = @"(.*? - .*?) \((\d{8})\)\.dat";
|
private static string _noIntroSpecialPattern = @"(.*? - .*?) \((\d{8})\)\.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$";
|
||||||
@@ -61,7 +61,8 @@ namespace SabreTools
|
|||||||
|
|
||||||
// Regex Date Patterns
|
// Regex Date Patterns
|
||||||
private static string _defaultDatePattern = @"(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})";
|
private static string _defaultDatePattern = @"(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})";
|
||||||
private static string _nointroDatePattern = @"(\d{4})(\d{2})(\d{2})-(\d{2})(\d{2})(\d{2})";
|
private static string _noIntroDatePattern = @"(\d{4})(\d{2})(\d{2})-(\d{2})(\d{2})(\d{2})";
|
||||||
|
private static string _noIntroSpecialDatePattern = @"(\d{4})(\d{2})(\d{2})";
|
||||||
private static string _redumpDatePattern = @"(\d{4})(\d{2})(\d{2}) (\d{2})-(\d{2})-(\d{2})";
|
private static string _redumpDatePattern = @"(\d{4})(\d{2})(\d{2}) (\d{2})-(\d{2})-(\d{2})";
|
||||||
private static string _tosecDatePattern = @"(\d{4})-(\d{2})-(\d{2})";
|
private static string _tosecDatePattern = @"(\d{4})-(\d{2})-(\d{2})";
|
||||||
|
|
||||||
@@ -122,9 +123,9 @@ namespace SabreTools
|
|||||||
fileinfo = Regex.Match(filename, _mamePattern).Groups;
|
fileinfo = Regex.Match(filename, _mamePattern).Groups;
|
||||||
type = DatType.MAME;
|
type = DatType.MAME;
|
||||||
}
|
}
|
||||||
else if (Regex.IsMatch(filename, _nointroPattern))
|
else if (Regex.IsMatch(filename, _noIntroPattern))
|
||||||
{
|
{
|
||||||
fileinfo = Regex.Match(filename, _nointroPattern).Groups;
|
fileinfo = Regex.Match(filename, _noIntroPattern).Groups;
|
||||||
type = DatType.NoIntro;
|
type = DatType.NoIntro;
|
||||||
}
|
}
|
||||||
// For numbered DATs only
|
// For numbered DATs only
|
||||||
@@ -136,7 +137,7 @@ namespace SabreTools
|
|||||||
// For N-Gage and Gizmondo only
|
// For N-Gage and Gizmondo only
|
||||||
else if (Regex.IsMatch(filename, _noIntroSpecialPattern))
|
else if (Regex.IsMatch(filename, _noIntroSpecialPattern))
|
||||||
{
|
{
|
||||||
fileinfo = Regex.Match(filename, _nointroPattern).Groups;
|
fileinfo = Regex.Match(filename, _noIntroSpecialPattern).Groups;
|
||||||
type = DatType.NoIntro;
|
type = DatType.NoIntro;
|
||||||
}
|
}
|
||||||
else if (Regex.IsMatch(filename, _redumpPattern))
|
else if (Regex.IsMatch(filename, _redumpPattern))
|
||||||
@@ -211,12 +212,18 @@ namespace SabreTools
|
|||||||
{
|
{
|
||||||
date = File.GetLastWriteTime(_filepath).ToString("yyyy-MM-dd HH:mm:ss");
|
date = File.GetLastWriteTime(_filepath).ToString("yyyy-MM-dd HH:mm:ss");
|
||||||
}
|
}
|
||||||
|
else if (Regex.IsMatch(fileinfo[2].Value, _noIntroDatePattern))
|
||||||
|
{
|
||||||
|
datestring = fileinfo[2].Value;
|
||||||
|
GroupCollection niDateInfo = Regex.Match(datestring, _noIntroDatePattern).Groups;
|
||||||
|
date = niDateInfo[1].Value + "-" + niDateInfo[2].Value + "-" + niDateInfo[3].Value + " " +
|
||||||
|
niDateInfo[4].Value + ":" + niDateInfo[5].Value + ":" + niDateInfo[6].Value;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
datestring = fileinfo[2].Value;
|
datestring = fileinfo[2].Value;
|
||||||
GroupCollection niDateInfo = Regex.Match(datestring, _nointroDatePattern).Groups;
|
GroupCollection niDateInfo = Regex.Match(datestring, _noIntroSpecialDatePattern).Groups;
|
||||||
date = niDateInfo[1].Value + "-" + niDateInfo[2].Value + "-" + niDateInfo[3].Value + " " +
|
date = niDateInfo[1].Value + "-" + niDateInfo[2].Value + "-" + niDateInfo[3].Value + " 00:00:00";
|
||||||
niDateInfo[4].Value + ":" + niDateInfo[5].Value + ":" + niDateInfo[6].Value;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case DatType.Redump:
|
case DatType.Redump:
|
||||||
|
|||||||
Reference in New Issue
Block a user