refactor: remove title description field
This commit is contained in:
@@ -343,7 +343,7 @@ namespace gaseous_identifier.classes
|
|||||||
switch (xmlGameDetail.Name.ToLower())
|
switch (xmlGameDetail.Name.ToLower())
|
||||||
{
|
{
|
||||||
case "description":
|
case "description":
|
||||||
gameObject.Description = xmlGameDetail.InnerText;
|
//gameObject.Description = xmlGameDetail.InnerText;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "rom":
|
case "rom":
|
||||||
|
@@ -101,66 +101,81 @@ if (availablePlatforms.Count > 0)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Console.WriteLine("Examining files");
|
//Console.WriteLine("Examining files");
|
||||||
string[] romPathContents = Directory.GetFiles(scanPath);
|
//string[] romPathContents = Directory.GetFiles(scanPath);
|
||||||
foreach (string romFile in romPathContents)
|
//foreach (string romFile in romPathContents)
|
||||||
|
//{
|
||||||
|
// Console.WriteLine("Checking " + romFile);
|
||||||
|
|
||||||
|
// var stream = File.OpenRead(romFile);
|
||||||
|
|
||||||
|
// var md5 = MD5.Create();
|
||||||
|
// byte[] md5HashByte = md5.ComputeHash(stream);
|
||||||
|
// string md5Hash = BitConverter.ToString(md5HashByte).Replace("-", "").ToLowerInvariant();
|
||||||
|
|
||||||
|
// var sha1 = SHA1.Create();
|
||||||
|
// byte[] sha1HashByte = sha1.ComputeHash(stream);
|
||||||
|
// string sha1Hash = BitConverter.ToString(sha1HashByte).Replace("-", "").ToLowerInvariant();
|
||||||
|
|
||||||
|
// bool gameFound = false;
|
||||||
|
// foreach (gaseous_identifier.objects.RomSignatureObject tosecList in romSignatures)
|
||||||
|
// {
|
||||||
|
// foreach (gaseous_identifier.objects.RomSignatureObject.Game gameObject in tosecList.Games)
|
||||||
|
// {
|
||||||
|
// foreach (gaseous_identifier.objects.RomSignatureObject.Game.Rom romObject in gameObject.Roms)
|
||||||
|
// {
|
||||||
|
// if (romObject.Md5 != null)
|
||||||
|
// {
|
||||||
|
// if (md5Hash == romObject.Md5.ToLowerInvariant())
|
||||||
|
// {
|
||||||
|
// // match
|
||||||
|
// gameFound = true;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// if (romObject.Sha1 != null)
|
||||||
|
// {
|
||||||
|
// if (md5Hash == romObject.Sha1.ToLowerInvariant())
|
||||||
|
// {
|
||||||
|
// // match
|
||||||
|
// gameFound = true;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// if (gameFound == true)
|
||||||
|
// {
|
||||||
|
// Console.WriteLine(romObject.Name);
|
||||||
|
|
||||||
|
// gaseous_identifier.objects.RomSignatureObject.Game gameSignature = gameObject;
|
||||||
|
// gameSignature.Roms.Clear();
|
||||||
|
// gameSignature.Roms.Add(romObject);
|
||||||
|
|
||||||
|
// var jsonSerializerSettings = new JsonSerializerSettings();
|
||||||
|
// jsonSerializerSettings.Converters.Add(new Newtonsoft.Json.Converters.StringEnumConverter());
|
||||||
|
// jsonSerializerSettings.NullValueHandling = NullValueHandling.Ignore;
|
||||||
|
// Console.WriteLine(Newtonsoft.Json.JsonConvert.SerializeObject(gameSignature, Newtonsoft.Json.Formatting.Indented, jsonSerializerSettings));
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// if (gameFound == true) { break; }
|
||||||
|
// }
|
||||||
|
// if (gameFound == true) { break; }
|
||||||
|
// }
|
||||||
|
// if (gameFound == false)
|
||||||
|
// {
|
||||||
|
// Console.WriteLine("File not found in TOSEC library");
|
||||||
|
// }
|
||||||
|
//}
|
||||||
|
|
||||||
|
string SearchTitle = "California Games";
|
||||||
|
foreach (gaseous_identifier.objects.RomSignatureObject romSignatureObject in romSignatures)
|
||||||
{
|
{
|
||||||
Console.WriteLine("Checking " + romFile);
|
foreach (gaseous_identifier.objects.RomSignatureObject.Game gameObject in romSignatureObject.Games)
|
||||||
|
|
||||||
var stream = File.OpenRead(romFile);
|
|
||||||
|
|
||||||
var md5 = MD5.Create();
|
|
||||||
byte[] md5HashByte = md5.ComputeHash(stream);
|
|
||||||
string md5Hash = BitConverter.ToString(md5HashByte).Replace("-", "").ToLowerInvariant();
|
|
||||||
|
|
||||||
var sha1 = SHA1.Create();
|
|
||||||
byte[] sha1HashByte = sha1.ComputeHash(stream);
|
|
||||||
string sha1Hash = BitConverter.ToString(sha1HashByte).Replace("-", "").ToLowerInvariant();
|
|
||||||
|
|
||||||
bool gameFound = false;
|
|
||||||
foreach (gaseous_identifier.objects.RomSignatureObject tosecList in romSignatures)
|
|
||||||
{
|
{
|
||||||
foreach (gaseous_identifier.objects.RomSignatureObject.Game gameObject in tosecList.Games)
|
if (gameObject.Name == SearchTitle)
|
||||||
{
|
{
|
||||||
foreach (gaseous_identifier.objects.RomSignatureObject.Game.Rom romObject in gameObject.Roms)
|
var jsonSerializerSettings = new JsonSerializerSettings();
|
||||||
{
|
jsonSerializerSettings.Converters.Add(new Newtonsoft.Json.Converters.StringEnumConverter());
|
||||||
if (romObject.Md5 != null)
|
jsonSerializerSettings.NullValueHandling = NullValueHandling.Ignore;
|
||||||
{
|
Console.WriteLine(Newtonsoft.Json.JsonConvert.SerializeObject(gameObject, Newtonsoft.Json.Formatting.Indented, jsonSerializerSettings));
|
||||||
if (md5Hash == romObject.Md5.ToLowerInvariant())
|
|
||||||
{
|
|
||||||
// match
|
|
||||||
gameFound = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (romObject.Sha1 != null)
|
|
||||||
{
|
|
||||||
if (md5Hash == romObject.Sha1.ToLowerInvariant())
|
|
||||||
{
|
|
||||||
// match
|
|
||||||
gameFound = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (gameFound == true)
|
|
||||||
{
|
|
||||||
Console.WriteLine(romObject.Name);
|
|
||||||
|
|
||||||
gaseous_identifier.objects.RomSignatureObject.Game gameSignature = gameObject;
|
|
||||||
gameSignature.Roms.Clear();
|
|
||||||
gameSignature.Roms.Add(romObject);
|
|
||||||
|
|
||||||
var jsonSerializerSettings = new JsonSerializerSettings();
|
|
||||||
jsonSerializerSettings.Converters.Add(new Newtonsoft.Json.Converters.StringEnumConverter());
|
|
||||||
jsonSerializerSettings.NullValueHandling = NullValueHandling.Ignore;
|
|
||||||
Console.WriteLine(Newtonsoft.Json.JsonConvert.SerializeObject(gameSignature, Newtonsoft.Json.Formatting.Indented, jsonSerializerSettings));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (gameFound == true) { break; }
|
|
||||||
}
|
}
|
||||||
if (gameFound == true) { break; }
|
|
||||||
}
|
|
||||||
if (gameFound == false)
|
|
||||||
{
|
|
||||||
Console.WriteLine("File not found in TOSEC library");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user