diff --git a/DATabase/MergeDiff.cs b/DATabase/MergeDiff.cs index f672705a..f513d59f 100644 --- a/DATabase/MergeDiff.cs +++ b/DATabase/MergeDiff.cs @@ -122,7 +122,7 @@ namespace SabreTools // Modify the Dictionary if necessary and output the results if (_diff) { - string post = ""; + string post = " (No Duplicates)"; // Get all entries that don't have External dupes DatData outerDiffData = new DatData @@ -161,8 +161,6 @@ namespace SabreTools } } - post = " (No Duplicates)"; - // Output the difflist (a-b)+(b-a) diff Output.WriteDatfile(outerDiffData, "", _logger); @@ -170,6 +168,7 @@ namespace SabreTools // Loop through _inputs first and filter from all diffed roms to find the ones that have the same "System" for (int j = 0; j < _inputs.Count; j++) { + post = " (" + Path.GetFileNameWithoutExtension(_inputs[j]) + " Only)"; DatData diffData = new DatData { Name = _name + post, @@ -204,11 +203,11 @@ namespace SabreTools } } - post = " (" + Path.GetFileNameWithoutExtension(_inputs[j]) + " Only)"; Output.WriteDatfile(diffData, "", _logger); } // Get all entries that have External dupes + post = " (Duplicates)"; DatData dupeData = new DatData { Name = _name + post, @@ -222,7 +221,6 @@ namespace SabreTools MergeRoms = _dedup, Roms = new Dictionary>(), }; - post = " (Duplicates)"; foreach (string key in userData.Roms.Keys) { List temp = userData.Roms[key]; diff --git a/SabreHelper/RomManipulation.cs b/SabreHelper/RomManipulation.cs index e6604967..94ebd356 100644 --- a/SabreHelper/RomManipulation.cs +++ b/SabreHelper/RomManipulation.cs @@ -462,24 +462,6 @@ namespace SabreTools.Helper last.MD5 = (last.MD5 == "" && rom.MD5 != "" ? rom.MD5 : last.MD5); last.SHA1 = (last.SHA1 == "" && rom.SHA1 != "" ? rom.SHA1 : last.SHA1); - // If the current system has a lower ID than the previous, set the system accordingly - if (rom.SystemID < last.SystemID) - { - last.SystemID = rom.SystemID; - last.System = rom.System; - last.Game = rom.Game; - last.Name = rom.Name; - } - - // If the current source has a lower ID than the previous, set the source accordingly - if (rom.SourceID < last.SourceID) - { - last.SourceID = rom.SourceID; - last.Source = rom.Source; - last.Game = rom.Game; - last.Name = rom.Name; - } - // If the duplicate is external already or should be, set it if (last.Dupe >= DupeType.ExternalHash || last.SystemID != rom.SystemID || last.SourceID != rom.SourceID) { @@ -506,6 +488,24 @@ namespace SabreTools.Helper } } + // If the current system has a lower ID than the previous, set the system accordingly + if (rom.SystemID < last.SystemID) + { + last.SystemID = rom.SystemID; + last.System = rom.System; + last.Game = rom.Game; + last.Name = rom.Name; + } + + // If the current source has a lower ID than the previous, set the source accordingly + if (rom.SourceID < last.SourceID) + { + last.SourceID = rom.SourceID; + last.Source = rom.Source; + last.Game = rom.Game; + last.Name = rom.Name; + } + outroms.RemoveAt(outroms.Count - 1); outroms.Insert(outroms.Count, last);