An attempt to make diffing work the way I think it should

Basically, if a rom is a duplicate, it can be a duplicate within a system or source or across system or source, and by hash alone or by all data matching. The four combinations make an enum now and the diff function is the only one that uses them right now. If we're in dedup mode, we want to check hashes only in diff. Otherwise, we want to check against ones that match all information. This  needs field testing.
This commit is contained in:
Matt Nadareski
2016-05-10 20:55:51 -07:00
parent d649988a04
commit 382f74afaa
4 changed files with 58 additions and 6 deletions

View File

@@ -628,7 +628,30 @@ namespace SabreTools.Helper
last.CRC = (last.CRC == "" && rom.CRC != "" ? rom.CRC : last.CRC);
last.MD5 = (last.MD5 == "" && rom.MD5 != "" ? rom.MD5 : last.MD5);
last.SHA1 = (last.SHA1 == "" && rom.SHA1 != "" ? rom.SHA1 : last.SHA1);
last.Dupe = true;
// If the duplicate is in the same system and dupe is not already set to External
if ((last.SystemID == rom.SystemID || last.SourceID == rom.SourceID) && last.Dupe != DupeType.ExternalHash)
{
if (last.Game == rom.Game && last.Name == rom.Name)
{
last.Dupe = DupeType.InternalAll;
}
else
{
last.Dupe = DupeType.InternalHash;
}
}
else
{
if (last.Game == rom.Game && last.Name == rom.Name)
{
last.Dupe = DupeType.ExternalAll;
}
else
{
last.Dupe = DupeType.ExternalHash;
}
}
outroms.RemoveAt(outroms.Count - 1);
outroms.Insert(outroms.Count, last);