mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Add preliminary support for NonGood
This commit is contained in:
@@ -24,6 +24,7 @@ namespace SabreTools
|
||||
private static string _noIntroPattern = @"^(.*?) \((\d{8}-\d{6})_CM\)\.dat$";
|
||||
private static string _noIntroNumberedPattern = @"(.*? - .*?) \(\d.*?_CM\).dat";
|
||||
private static string _noIntroSpecialPattern = @"(.*? - .*?) \((\d{8})\)\.dat";
|
||||
private static string _nonGoodPattern = @"(NonGood.*?)( .*)?.dat";
|
||||
private static string _redumpPattern = @"^(.*?) \((\d{8} \d{2}-\d{2}-\d{2})\)\.dat$";
|
||||
private static string _redumpBiosPattern = @"^(.*?) \(\d+\) \((\d{4}-\d{2}-\d{2})\)\.dat$";
|
||||
private static string _tosecPattern = @"^(.*?) - .* \(TOSEC-v(\d{4}-\d{2}-\d{2})_CM\)\.dat$";
|
||||
@@ -53,6 +54,7 @@ namespace SabreTools
|
||||
Redump,
|
||||
TOSEC,
|
||||
TruRip,
|
||||
NonGood,
|
||||
}
|
||||
|
||||
// Public instance variables
|
||||
@@ -115,6 +117,11 @@ namespace SabreTools
|
||||
fileinfo = Regex.Match(filename, _noIntroSpecialPattern).Groups;
|
||||
type = DatType.NoIntro;
|
||||
}
|
||||
else if (Regex.IsMatch(filename, _nonGoodPattern))
|
||||
{
|
||||
fileinfo = Regex.Match(filename, _nonGoodPattern).Groups;
|
||||
type = DatType.NonGood;
|
||||
}
|
||||
else if (Regex.IsMatch(filename, _redumpPattern))
|
||||
{
|
||||
fileinfo = Regex.Match(filename, _redumpPattern).Groups;
|
||||
@@ -201,6 +208,19 @@ namespace SabreTools
|
||||
date = niDateInfo[1].Value + "-" + niDateInfo[2].Value + "-" + niDateInfo[3].Value + " 00:00:00";
|
||||
}
|
||||
break;
|
||||
case DatType.NonGood:
|
||||
if (!Remapping.NonGood.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 nonGoodInfo = Regex.Match(Remapping.NonGood[fileinfo[1].Value], _remappedPattern).Groups;
|
||||
|
||||
manufacturer = nonGoodInfo[1].Value;
|
||||
system = nonGoodInfo[2].Value;
|
||||
source = "NonGood";
|
||||
date = File.GetLastWriteTime(_filepath).ToString("yyyy-MM-dd HH:mm:ss");
|
||||
break;
|
||||
case DatType.Redump:
|
||||
if (!Remapping.Redump.ContainsKey(fileinfo[1].Value))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user