Broadest matches should go last

This commit is contained in:
Matt Nadareski
2016-04-07 13:06:46 -07:00
parent c19b5ba1b2
commit 66000609e7

View File

@@ -98,10 +98,10 @@ namespace SabreTools
GroupCollection fileinfo;
DatType type = DatType.none;
if (Regex.IsMatch(filename, _mamePattern))
if (Regex.IsMatch(filename, _nonGoodPattern))
{
fileinfo = Regex.Match(filename, _mamePattern).Groups;
type = DatType.MAME;
fileinfo = Regex.Match(filename, _nonGoodPattern).Groups;
type = DatType.NonGood;
}
else if (Regex.IsMatch(filename, _maybeIntroPattern))
{
@@ -125,11 +125,6 @@ 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;
@@ -162,6 +157,11 @@ namespace SabreTools
fileinfo = Regex.Match(filename, _defaultPattern).Groups;
type = DatType.Custom;
}
else if (Regex.IsMatch(filename, _mamePattern))
{
fileinfo = Regex.Match(filename, _mamePattern).Groups;
type = DatType.MAME;
}
// If the type is still unmatched, the data can't be imported yet
else
{