From 048dac93b251b2f7f199b2c8ebb0d83568c794a4 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Wed, 2 Jan 2019 23:17:49 -0800 Subject: [PATCH] Treat CHDs fairly in sort --- SabreTools.Library/DatFiles/DatFile.cs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/SabreTools.Library/DatFiles/DatFile.cs b/SabreTools.Library/DatFiles/DatFile.cs index b498397d..34d927d8 100644 --- a/SabreTools.Library/DatFiles/DatFile.cs +++ b/SabreTools.Library/DatFiles/DatFile.cs @@ -3576,9 +3576,17 @@ namespace SabreTools.Library.DatFiles continue; } - // Otherwise, we rebuild that file to all locations that we need to - RebuildIndividualFile(new Rom(fileinfo), foundpath, outDir, date, inverse, outputFormat, romba, - updateDat, false /* isZip */, headerToCheckAgainst); + // Otherwise, we rebuild that file to all locations that we need to + if (this[hash][0].Type == ItemType.Disk) + { + RebuildIndividualFile(new Disk(fileinfo), foundpath, outDir, date, inverse, outputFormat, romba, + updateDat, false /* isZip */, headerToCheckAgainst); + } + else + { + RebuildIndividualFile(new Rom(fileinfo), foundpath, outDir, date, inverse, outputFormat, romba, + updateDat, false /* isZip */, headerToCheckAgainst); + } } watch.Stop(); @@ -4268,7 +4276,8 @@ namespace SabreTools.Library.DatFiles } // Now we want to remove all duplicates from the DAT - new Rom(fileinfo).GetDuplicates(this, remove: true); + new Rom(fileinfo).GetDuplicates(this, remove: true) + .AddRange(new Disk(fileinfo).GetDuplicates(this, remove: true)); } watch.Stop();