mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[DatTools, RomTools] Fix hash case matching causing merge issues
This commit is contained in:
@@ -1395,27 +1395,27 @@ namespace SabreTools.Helper
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Process each all of the roms
|
// Process each all of the roms
|
||||||
foreach (List<Rom> roms in dict.Values)
|
foreach (string key in dict.Keys)
|
||||||
{
|
{
|
||||||
List<Rom> newroms = roms;
|
List<Rom> roms = dict[key];
|
||||||
if (mergeroms)
|
if (mergeroms)
|
||||||
{
|
{
|
||||||
newroms = RomTools.Merge(newroms, logger);
|
roms = RomTools.Merge(roms, logger);
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (Rom rom in newroms)
|
foreach (Rom rom in roms)
|
||||||
{
|
{
|
||||||
count++;
|
count++;
|
||||||
string key = (norename ? "" : rom.Metadata.SystemID.ToString().PadLeft(10, '0') + "-" + rom.Metadata.SourceID.ToString().PadLeft(10, '0') + "-") + rom.Game.ToLowerInvariant();
|
string newkey = (norename ? "" : rom.Metadata.SystemID.ToString().PadLeft(10, '0') + "-" + rom.Metadata.SourceID.ToString().PadLeft(10, '0') + "-") + rom.Game.ToLowerInvariant();
|
||||||
if (sortable.ContainsKey(key))
|
if (sortable.ContainsKey(newkey))
|
||||||
{
|
{
|
||||||
sortable[key].Add(rom);
|
sortable[newkey].Add(rom);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
List<Rom> temp = new List<Rom>();
|
List<Rom> temp = new List<Rom>();
|
||||||
temp.Add(rom);
|
temp.Add(rom);
|
||||||
sortable.Add(key, temp);
|
sortable.Add(newkey, temp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -356,9 +356,10 @@ namespace SabreTools.Helper
|
|||||||
hash = (hash.StartsWith("0x") ? hash.Remove(0, 2) : hash);
|
hash = (hash.StartsWith("0x") ? hash.Remove(0, 2) : hash);
|
||||||
hash = (hash == "-" ? "" : hash);
|
hash = (hash == "-" ? "" : hash);
|
||||||
hash = (String.IsNullOrEmpty(hash) ? "" : hash.PadLeft(padding, '0'));
|
hash = (String.IsNullOrEmpty(hash) ? "" : hash.PadLeft(padding, '0'));
|
||||||
|
hash = hash.ToLowerInvariant();
|
||||||
|
|
||||||
// Then make sure that it has the correct characters
|
// Then make sure that it has the correct characters
|
||||||
if (!Regex.IsMatch(hash.ToLowerInvariant(), "[0-9a-f]{" + padding + "}"))
|
if (!Regex.IsMatch(hash, "[0-9a-f]{" + padding + "}"))
|
||||||
{
|
{
|
||||||
hash = "";
|
hash = "";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user