mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Add additional logic for numbered DATs
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
using System.Data.SQLite;
|
using System.Data.SQLite;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
@@ -47,7 +48,8 @@ namespace SabreTools
|
|||||||
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 _noIntroSpecialPattern = @"(.*? - .*?) \((\d{8}\)\.dat";
|
private static string _noIntroNumberedPattern = @"(.*? - .*?) \(.*?_CM\).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$";
|
||||||
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 _tosecSpecialPattern = @"^(.*? - .*? - .*?) - .* \(TOSEC-v(\d{4}-\d{2}-\d{2})_CM\)\.dat$";
|
||||||
@@ -124,6 +126,12 @@ namespace SabreTools
|
|||||||
fileinfo = Regex.Match(filename, _nointroPattern).Groups;
|
fileinfo = Regex.Match(filename, _nointroPattern).Groups;
|
||||||
type = DatType.NoIntro;
|
type = DatType.NoIntro;
|
||||||
}
|
}
|
||||||
|
// For numbered DATs only
|
||||||
|
else if (Regex.IsMatch(filename, _noIntroNumberedPattern))
|
||||||
|
{
|
||||||
|
fileinfo = Regex.Match(filename, _noIntroNumberedPattern).Groups;
|
||||||
|
type = DatType.NoIntro;
|
||||||
|
}
|
||||||
// For N-Gage and Gizmondo only
|
// For N-Gage and Gizmondo only
|
||||||
else if (Regex.IsMatch(filename, _noIntroSpecialPattern))
|
else if (Regex.IsMatch(filename, _noIntroSpecialPattern))
|
||||||
{
|
{
|
||||||
@@ -190,10 +198,17 @@ namespace SabreTools
|
|||||||
manufacturer = nointroInfo[1].Value;
|
manufacturer = nointroInfo[1].Value;
|
||||||
system = nointroInfo[2].Value;
|
system = nointroInfo[2].Value;
|
||||||
source = "no-Intro";
|
source = "no-Intro";
|
||||||
|
if (fileinfo.Count < 2)
|
||||||
|
{
|
||||||
|
date = File.GetLastWriteTime(_filepath).ToString("yyyy-MM-dd HH:mm:ss");
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
datestring = fileinfo[2].Value;
|
datestring = fileinfo[2].Value;
|
||||||
GroupCollection niDateInfo = Regex.Match(datestring, _nointroDatePattern).Groups;
|
GroupCollection niDateInfo = Regex.Match(datestring, _nointroDatePattern).Groups;
|
||||||
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))
|
||||||
|
|||||||
Reference in New Issue
Block a user