Handle most places where source was being set for IDDB

This commit is contained in:
Matt Nadareski
2024-03-20 02:10:38 -04:00
parent 106e91690b
commit 54180310b8
5 changed files with 128 additions and 12 deletions

View File

@@ -313,7 +313,7 @@ namespace SabreTools.DatTools
foreach ((long, DatItem) datItem in datItems)
{
var dupes = datFile.ItemsDB.GetDuplicates(datItem.Item2, sorted: true);
var dupes = datFile.ItemsDB.GetDuplicates(datItem, sorted: true);
if (datItem.Item2.Clone() is not DatItem newDatItem)
continue;

View File

@@ -579,7 +579,7 @@ namespace SabreTools.DatTools
/// <param name="inverse">True if the DAT should be used as a filter instead of a template, false otherwise</param>
/// <param name="dupes">Output list of duplicate items to rebuild to</param>
/// <returns>True if the item should be rebuilt, false otherwise</returns>
private static bool ShouldRebuildDB(DatFile datFile, DatItem datItem, Stream? stream, bool inverse, out ConcurrentList<(long, DatItem)> dupes)
private static bool ShouldRebuildDB(DatFile datFile, (long, DatItem) datItem, Stream? stream, bool inverse, out ConcurrentList<(long, DatItem)> dupes)
{
// Find if the file has duplicates in the DAT
dupes = datFile.ItemsDB.GetDuplicates(datItem);

View File

@@ -182,8 +182,8 @@ namespace SabreTools.DatTools
continue;
// Now we want to remove all duplicates from the DAT
datFile.ItemsDB.GetDuplicates(new Rom(fileinfo))
.AddRange(datFile.ItemsDB.GetDuplicates(new Disk(fileinfo)));
datFile.ItemsDB.GetDuplicates((-1, new Rom(fileinfo)))
.AddRange(datFile.ItemsDB.GetDuplicates((-1, new Disk(fileinfo))));
}
watch.Stop();