mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Forgot the other Parse
This commit is contained in:
@@ -458,11 +458,16 @@ namespace SabreTools.Helper
|
|||||||
Int64.TryParse(xtr.GetAttribute("size"), out size);
|
Int64.TryParse(xtr.GetAttribute("size"), out size);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Take care of hex-prefixed hashes
|
||||||
|
string crc = (xtr.GetAttribute("crc") != null ? xtr.GetAttribute("crc").ToLowerInvariant().Trim() : "");
|
||||||
|
crc = (crc.StartsWith("0x") ? crc.Remove(0, 2) : crc);
|
||||||
|
string md5 = (xtr.GetAttribute("md5") != null ? xtr.GetAttribute("md5").ToLowerInvariant().Trim() : "");
|
||||||
|
md5 = (md5.StartsWith("0x") ? md5.Remove(0, 2) : md5);
|
||||||
|
string sha1 = (xtr.GetAttribute("sha1") != null ? xtr.GetAttribute("sha1").ToLowerInvariant().Trim() : "");
|
||||||
|
sha1 = (sha1.StartsWith("0x") ? sha1.Remove(0, 2) : sha1);
|
||||||
|
|
||||||
// Get the new values to add
|
// Get the new values to add
|
||||||
string key = (xtr.GetAttribute("crc") != null ? xtr.GetAttribute("crc").ToLowerInvariant().Trim() : "") + "-" +
|
string key = crc + "-" + md5 + "-" + sha1 + "-" + size;
|
||||||
(xtr.GetAttribute("md5") != null ? xtr.GetAttribute("md5").ToLowerInvariant().Trim() : "") + "-" +
|
|
||||||
(xtr.GetAttribute("sha1") != null ? xtr.GetAttribute("sha1").ToLowerInvariant().Trim() : "") + "-" +
|
|
||||||
size;
|
|
||||||
RomData value = new RomData
|
RomData value = new RomData
|
||||||
{
|
{
|
||||||
Game = tempname,
|
Game = tempname,
|
||||||
@@ -471,9 +476,9 @@ namespace SabreTools.Helper
|
|||||||
SystemID = sysid,
|
SystemID = sysid,
|
||||||
SourceID = srcid,
|
SourceID = srcid,
|
||||||
Size = size,
|
Size = size,
|
||||||
CRC = (xtr.GetAttribute("crc") != null ? xtr.GetAttribute("crc").ToLowerInvariant().Trim() : ""),
|
CRC = crc,
|
||||||
MD5 = (xtr.GetAttribute("md5") != null ? xtr.GetAttribute("md5").ToLowerInvariant().Trim() : ""),
|
MD5 = md5,
|
||||||
SHA1 = (xtr.GetAttribute("sha1") != null ? xtr.GetAttribute("sha1").ToLowerInvariant().Trim() : ""),
|
SHA1 = sha1,
|
||||||
System = filename,
|
System = filename,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user