mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Rename DatType enums to match mappings
This commit is contained in:
@@ -35,12 +35,12 @@ namespace WoD
|
|||||||
private enum DatType
|
private enum DatType
|
||||||
{
|
{
|
||||||
none = 0,
|
none = 0,
|
||||||
custom,
|
Custom,
|
||||||
mame,
|
MAME,
|
||||||
nointro,
|
NoIntro,
|
||||||
redump,
|
Redump,
|
||||||
tosec,
|
TOSEC,
|
||||||
trurip,
|
TruRip,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Public instance variables
|
// Public instance variables
|
||||||
@@ -76,32 +76,32 @@ namespace WoD
|
|||||||
if (Regex.IsMatch(filename, _mamePattern))
|
if (Regex.IsMatch(filename, _mamePattern))
|
||||||
{
|
{
|
||||||
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;
|
||||||
}
|
}
|
||||||
else if (Regex.IsMatch(filename, _redumpPattern))
|
else if (Regex.IsMatch(filename, _redumpPattern))
|
||||||
{
|
{
|
||||||
fileinfo = Regex.Match(filename, _redumpPattern).Groups;
|
fileinfo = Regex.Match(filename, _redumpPattern).Groups;
|
||||||
type = DatType.redump;
|
type = DatType.Redump;
|
||||||
}
|
}
|
||||||
else if (Regex.IsMatch(filename, _tosecPattern))
|
else if (Regex.IsMatch(filename, _tosecPattern))
|
||||||
{
|
{
|
||||||
fileinfo = Regex.Match(filename, _tosecPattern).Groups;
|
fileinfo = Regex.Match(filename, _tosecPattern).Groups;
|
||||||
type = DatType.tosec;
|
type = DatType.TOSEC;
|
||||||
}
|
}
|
||||||
else if (Regex.IsMatch(filename, _truripPattern))
|
else if (Regex.IsMatch(filename, _truripPattern))
|
||||||
{
|
{
|
||||||
fileinfo = Regex.Match(filename, _truripPattern).Groups;
|
fileinfo = Regex.Match(filename, _truripPattern).Groups;
|
||||||
type = DatType.trurip;
|
type = DatType.TruRip;
|
||||||
}
|
}
|
||||||
else if (Regex.IsMatch(filename, _defaultPattern))
|
else if (Regex.IsMatch(filename, _defaultPattern))
|
||||||
{
|
{
|
||||||
fileinfo = Regex.Match(filename, _defaultPattern).Groups;
|
fileinfo = Regex.Match(filename, _defaultPattern).Groups;
|
||||||
type = DatType.custom;
|
type = DatType.Custom;
|
||||||
}
|
}
|
||||||
// If the type is still unmatched, the data can't be imported yet
|
// If the type is still unmatched, the data can't be imported yet
|
||||||
else
|
else
|
||||||
@@ -119,7 +119,7 @@ namespace WoD
|
|||||||
|
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case DatType.mame:
|
case DatType.MAME:
|
||||||
if (!Remapping.MAME.ContainsKey(fileinfo[1].Value))
|
if (!Remapping.MAME.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");
|
||||||
@@ -132,7 +132,7 @@ namespace WoD
|
|||||||
source = "MAME";
|
source = "MAME";
|
||||||
date = File.GetLastWriteTime(_filepath).ToString("yyyy-MM-dd HH:mm:ss");
|
date = File.GetLastWriteTime(_filepath).ToString("yyyy-MM-dd HH:mm:ss");
|
||||||
break;
|
break;
|
||||||
case DatType.nointro:
|
case DatType.NoIntro:
|
||||||
if (!Remapping.NoIntro.ContainsKey(fileinfo[1].Value))
|
if (!Remapping.NoIntro.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");
|
||||||
@@ -148,7 +148,7 @@ namespace WoD
|
|||||||
date = niDateInfo[1].Value + "-" + niDateInfo[2].Value + "-" + niDateInfo[3].Value + " " +
|
date = niDateInfo[1].Value + "-" + niDateInfo[2].Value + "-" + niDateInfo[3].Value + " " +
|
||||||
niDateInfo[4].Value + ":" + niDateInfo[5].Value + ":" + niDateInfo[6].Value;
|
niDateInfo[4].Value + ":" + niDateInfo[5].Value + ":" + niDateInfo[6].Value;
|
||||||
break;
|
break;
|
||||||
case DatType.redump:
|
case DatType.Redump:
|
||||||
if (!Remapping.Redump.ContainsKey(fileinfo[1].Value))
|
if (!Remapping.Redump.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");
|
||||||
@@ -164,7 +164,7 @@ namespace WoD
|
|||||||
date = rdDateInfo[1].Value + "-" + rdDateInfo[2].Value + "-" + rdDateInfo[3].Value + " " +
|
date = rdDateInfo[1].Value + "-" + rdDateInfo[2].Value + "-" + rdDateInfo[3].Value + " " +
|
||||||
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))
|
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");
|
||||||
@@ -179,7 +179,7 @@ namespace WoD
|
|||||||
GroupCollection toDateInfo = Regex.Match(datestring, _tosecDatePattern).Groups;
|
GroupCollection toDateInfo = Regex.Match(datestring, _tosecDatePattern).Groups;
|
||||||
date = toDateInfo[1].Value + "-" + toDateInfo[2].Value + "-" + toDateInfo[3].Value + " 00:00:00";
|
date = toDateInfo[1].Value + "-" + toDateInfo[2].Value + "-" + toDateInfo[3].Value + " 00:00:00";
|
||||||
break;
|
break;
|
||||||
case DatType.trurip:
|
case DatType.TruRip:
|
||||||
if (!Remapping.TruRip.ContainsKey(fileinfo[1].Value))
|
if (!Remapping.TruRip.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");
|
||||||
@@ -192,7 +192,7 @@ namespace WoD
|
|||||||
source = "trurip";
|
source = "trurip";
|
||||||
date = File.GetLastWriteTime(_filepath).ToString("yyyy-MM-dd HH:mm:ss");
|
date = File.GetLastWriteTime(_filepath).ToString("yyyy-MM-dd HH:mm:ss");
|
||||||
break;
|
break;
|
||||||
case DatType.custom:
|
case DatType.Custom:
|
||||||
default:
|
default:
|
||||||
manufacturer = fileinfo[1].Value;
|
manufacturer = fileinfo[1].Value;
|
||||||
system = fileinfo[2].Value;
|
system = fileinfo[2].Value;
|
||||||
|
|||||||
Reference in New Issue
Block a user