mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[DatFile] Be more mindful of item types
This commit is contained in:
@@ -524,12 +524,15 @@ namespace SabreTools.Helper.Dats
|
|||||||
foreach (string key in Keys)
|
foreach (string key in Keys)
|
||||||
{
|
{
|
||||||
List<DatItem> roms = this[key];
|
List<DatItem> roms = this[key];
|
||||||
foreach (Rom rom in roms)
|
foreach (DatItem rom in roms)
|
||||||
{
|
{
|
||||||
if (rom.SourceID == 99)
|
if (rom.SourceID == 99)
|
||||||
{
|
{
|
||||||
found = true;
|
found = true;
|
||||||
matched.Add(rom.Size + "-" + rom.CRC, rom);
|
if (rom.Type == ItemType.Disk || rom.Type == ItemType.Rom)
|
||||||
|
{
|
||||||
|
matched.Add(((Disk)rom).SHA1, rom);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,27 +49,38 @@ namespace SabreTools.Helper.Dats
|
|||||||
// Loop through and add
|
// Loop through and add
|
||||||
foreach (string key in Keys)
|
foreach (string key in Keys)
|
||||||
{
|
{
|
||||||
List<DatItem> roms = this[key];
|
List<DatItem> items = this[key];
|
||||||
foreach (Rom rom in roms)
|
foreach (DatItem item in items)
|
||||||
{
|
{
|
||||||
RomCount += (rom.Type == ItemType.Rom ? 1 : 0);
|
switch (item.Type)
|
||||||
DiskCount += (rom.Type == ItemType.Disk ? 1 : 0);
|
{
|
||||||
TotalSize += (rom.ItemStatus == ItemStatus.Nodump ? 0 : rom.Size);
|
case ItemType.Archive:
|
||||||
CRCCount += (String.IsNullOrEmpty(rom.CRC) ? 0 : 1);
|
break;
|
||||||
MD5Count += (String.IsNullOrEmpty(rom.MD5) ? 0 : 1);
|
case ItemType.BiosSet:
|
||||||
SHA1Count += (String.IsNullOrEmpty(rom.SHA1) ? 0 : 1);
|
break;
|
||||||
BaddumpCount += (rom.Type == ItemType.Disk
|
case ItemType.Disk:
|
||||||
? (((Disk)rom).ItemStatus == ItemStatus.BadDump ? 1 : 0)
|
Disk disk = (Disk)item;
|
||||||
: (rom.Type == ItemType.Rom
|
DiskCount += 1;
|
||||||
? (((Rom)rom).ItemStatus == ItemStatus.BadDump ? 1 : 0)
|
MD5Count += (String.IsNullOrEmpty(disk.MD5) ? 0 : 1);
|
||||||
: 0)
|
SHA1Count += (String.IsNullOrEmpty(disk.SHA1) ? 0 : 1);
|
||||||
);
|
BaddumpCount += (disk.ItemStatus == ItemStatus.BadDump ? 1 : 0);
|
||||||
NodumpCount += (rom.Type == ItemType.Disk
|
NodumpCount += (disk.ItemStatus == ItemStatus.Nodump ? 1 : 0);
|
||||||
? (((Disk)rom).ItemStatus == ItemStatus.Nodump ? 1 : 0)
|
break;
|
||||||
: (rom.Type == ItemType.Rom
|
case ItemType.Release:
|
||||||
? (((Rom)rom).ItemStatus == ItemStatus.Nodump ? 1 : 0)
|
break;
|
||||||
: 0)
|
case ItemType.Rom:
|
||||||
);
|
Rom rom = (Rom)item;
|
||||||
|
RomCount += 1;
|
||||||
|
TotalSize += (rom.ItemStatus == ItemStatus.Nodump ? 0 : rom.Size);
|
||||||
|
CRCCount += (String.IsNullOrEmpty(rom.CRC) ? 0 : 1);
|
||||||
|
MD5Count += (String.IsNullOrEmpty(rom.MD5) ? 0 : 1);
|
||||||
|
SHA1Count += (String.IsNullOrEmpty(rom.SHA1) ? 0 : 1);
|
||||||
|
BaddumpCount += (rom.ItemStatus == ItemStatus.BadDump ? 1 : 0);
|
||||||
|
NodumpCount += (rom.ItemStatus == ItemStatus.Nodump ? 1 : 0);
|
||||||
|
break;
|
||||||
|
case ItemType.Sample:
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user