diff --git a/SabreTools.Library/Dats/DatFile.cs b/SabreTools.Library/Dats/DatFile.cs index aec0ae68..34d810a6 100644 --- a/SabreTools.Library/Dats/DatFile.cs +++ b/SabreTools.Library/Dats/DatFile.cs @@ -1,5 +1,5 @@ -using System.Collections.Generic; -using System.Threading.Tasks; +using System; +using System.Collections.Generic; using SabreTools.Library.Data; @@ -48,6 +48,8 @@ namespace SabreTools.Library.Dats private bool _romba; // Statistical data related to the DAT + private object _statslock = new object(); + private long _count; private long _romCount; private long _diskCount; private long _totalSize; @@ -183,7 +185,6 @@ namespace SabreTools.Library.Dats public SortedBy SortedBy { get { return _sortedBy; } - set { _sortedBy = value; } } // Data specific to the Miss DAT type @@ -234,60 +235,53 @@ namespace SabreTools.Library.Dats } // Statistical data related to the DAT + public long Count + { + get { return _count; } + } public long RomCount { get { return _romCount; } - set { _romCount = value; } } public long DiskCount { get { return _diskCount; } - set { _diskCount = value; } } public long TotalSize { get { return _totalSize; } - set { _totalSize = value; } } public long CRCCount { get { return _crcCount; } - set { _crcCount = value; } } public long MD5Count { get { return _md5Count; } - set { _md5Count = value; } } public long SHA1Count { get { return _sha1Count; } - set { _sha1Count = value; } } public long SHA256Count { get { return _sha256Count; } - set { _sha256Count = value; } } public long SHA384Count { get { return _sha384Count; } - set { _sha384Count = value; } } public long SHA512Count { get { return _sha512Count; } - set { _sha512Count = value; } } public long BaddumpCount { get { return _baddumpCount; } - set { _baddumpCount = value; } } public long NodumpCount { get { return _nodumpCount; } - set { _nodumpCount = value; } } #endregion @@ -347,7 +341,7 @@ namespace SabreTools.Library.Dats /// /// Add a new key to the file dictionary /// - /// Key in the dictionary to add to + /// Key in the dictionary to add public void Add(string key) { // If the dictionary is null, create it @@ -379,16 +373,16 @@ namespace SabreTools.Library.Dats _files = new SortedDictionary>(); } + // Add the key, if necessary + Add(key); + lock (_files) { - // If the key is missing from the dictionary, add it - if (!_files.ContainsKey(key)) - { - _files.Add(key, new List()); - } - // Now add the value _files[key].Add(value); + + // Now update the statistics + AddItemStatistics(value); } } @@ -405,16 +399,19 @@ namespace SabreTools.Library.Dats _files = new SortedDictionary>(); } + // Add the key, if necessary + Add(key); + lock (_files) { - // If the key is missing from the dictionary, add it - if (!_files.ContainsKey(key)) - { - _files.Add(key, new List()); - } - // Now add the value _files[key].AddRange(value); + + // Now update the statistics + foreach (DatItem item in value) + { + AddItemStatistics(item); + } } } @@ -443,39 +440,15 @@ namespace SabreTools.Library.Dats } } - /// - /// Get the number of DatItems in the file dictionary - /// - /// Number of DatItems in the file dictionary - public long Count - { - get - { - // If the dictionary is null, create it - if (_files == null) - { - _files = new SortedDictionary>(); - } - - lock (_files) - { - int count = 0; - foreach (string key in _files.Keys) - { - count += _files[key].Count; - } - - return count; - } - } - } - /// /// Delete the file dictionary /// public void Delete() { _files = null; + + // Reset statistics + ResetStatistics(); } /// @@ -516,6 +489,12 @@ namespace SabreTools.Library.Dats // If the key is in the dictionary, remove it if (_files.ContainsKey(key)) { + // Remove the statistics first + foreach (DatItem item in _files[key]) + { + RemoveItemStatistics(item); + } + _files.Remove(key); } } @@ -527,15 +506,9 @@ namespace SabreTools.Library.Dats public void Reset() { _files = new SortedDictionary>(); - } - /// - /// Set a new file dictionary from an existing one - /// - /// - public void Set(SortedDictionary> newdict) - { - _files = newdict; + // Reset statistics + ResetStatistics(); } #endregion diff --git a/SabreTools.Library/Dats/Partials/DatFile.ConvertUpdate.cs b/SabreTools.Library/Dats/Partials/DatFile.ConvertUpdate.cs index 7962cf96..6899dc87 100644 --- a/SabreTools.Library/Dats/Partials/DatFile.ConvertUpdate.cs +++ b/SabreTools.Library/Dats/Partials/DatFile.ConvertUpdate.cs @@ -197,7 +197,7 @@ namespace SabreTools.Library.Dats Globals.ParallelOptions, path => { - Globals.Logger.User("Comparing '" + path + "' to base DAT"); + Globals.Logger.User("Comparing '" + path.Split('¬')[0] + "' to base DAT"); // First we parse in the DAT internally DatFile intDat = new DatFile(); diff --git a/SabreTools.Library/Dats/Partials/DatFile.Parsers.cs b/SabreTools.Library/Dats/Partials/DatFile.Parsers.cs index 5b5224d3..e03922cd 100644 --- a/SabreTools.Library/Dats/Partials/DatFile.Parsers.cs +++ b/SabreTools.Library/Dats/Partials/DatFile.Parsers.cs @@ -3121,38 +3121,9 @@ namespace SabreTools.Library.Dats break; case ItemType.Disk: key = ((Disk)item).MD5; - - // Add statistical data - DiskCount += 1; - if (((Disk)item).ItemStatus != ItemStatus.Nodump) - { - TotalSize += 0; - MD5Count += (String.IsNullOrEmpty(((Disk)item).MD5) ? 0 : 1); - SHA1Count += (String.IsNullOrEmpty(((Disk)item).SHA1) ? 0 : 1); - SHA256Count += (String.IsNullOrEmpty(((Disk)item).SHA256) ? 0 : 1); - SHA384Count += (String.IsNullOrEmpty(((Disk)item).SHA384) ? 0 : 1); - SHA512Count += (String.IsNullOrEmpty(((Disk)item).SHA512) ? 0 : 1); - } - BaddumpCount += (((Disk)item).ItemStatus == ItemStatus.BadDump ? 1 : 0); - NodumpCount += (((Disk)item).ItemStatus == ItemStatus.Nodump ? 1 : 0); break; case ItemType.Rom: key = ((Rom)item).Size + "-" + ((Rom)item).CRC; - - // Add statistical data - RomCount += 1; - if (((Rom)item).ItemStatus != ItemStatus.Nodump) - { - TotalSize += ((Rom)item).Size; - CRCCount += (String.IsNullOrEmpty(((Rom)item).CRC) ? 0 : 1); - MD5Count += (String.IsNullOrEmpty(((Rom)item).MD5) ? 0 : 1); - SHA1Count += (String.IsNullOrEmpty(((Rom)item).SHA1) ? 0 : 1); - SHA256Count += (String.IsNullOrEmpty(((Rom)item).SHA256) ? 0 : 1); - SHA384Count += (String.IsNullOrEmpty(((Rom)item).SHA384) ? 0 : 1); - SHA512Count += (String.IsNullOrEmpty(((Rom)item).SHA512) ? 0 : 1); - } - BaddumpCount += (((Rom)item).ItemStatus == ItemStatus.BadDump ? 1 : 0); - NodumpCount += (((Rom)item).ItemStatus == ItemStatus.Nodump ? 1 : 0); break; default: key = "default"; diff --git a/SabreTools.Library/Dats/Partials/DatFile.Statistics.cs b/SabreTools.Library/Dats/Partials/DatFile.Statistics.cs index d3b2f054..5fba3f55 100644 --- a/SabreTools.Library/Dats/Partials/DatFile.Statistics.cs +++ b/SabreTools.Library/Dats/Partials/DatFile.Statistics.cs @@ -28,21 +28,146 @@ namespace SabreTools.Library.Dats #region Statistics + /// + /// Add to the internal statistics given a DatItem + /// + /// Item to add info from + private void AddItemStatistics(DatItem item) + { + // No matter what the item is, we increate the count + lock (_statslock) + { + _count += 1; + + // Now we do different things for each item type + + switch (item.Type) + { + case ItemType.Archive: + break; + case ItemType.BiosSet: + break; + case ItemType.Disk: + _diskCount += 1; + if (((Disk)item).ItemStatus != ItemStatus.Nodump) + { + _md5Count += (String.IsNullOrEmpty(((Disk)item).MD5) ? 0 : 1); + _sha1Count += (String.IsNullOrEmpty(((Disk)item).SHA1) ? 0 : 1); + _sha256Count += (String.IsNullOrEmpty(((Disk)item).SHA256) ? 0 : 1); + _sha384Count += (String.IsNullOrEmpty(((Disk)item).SHA384) ? 0 : 1); + _sha512Count += (String.IsNullOrEmpty(((Disk)item).SHA512) ? 0 : 1); + } + + _baddumpCount += (((Disk)item).ItemStatus == ItemStatus.BadDump ? 1 : 0); + _nodumpCount += (((Disk)item).ItemStatus == ItemStatus.Nodump ? 1 : 0); + break; + case ItemType.Release: + break; + case ItemType.Rom: + _romCount += 1; + if (((Rom)item).ItemStatus != ItemStatus.Nodump) + { + _totalSize += ((Rom)item).Size; + _crcCount += (String.IsNullOrEmpty(((Rom)item).CRC) ? 0 : 1); + _md5Count += (String.IsNullOrEmpty(((Rom)item).MD5) ? 0 : 1); + _sha1Count += (String.IsNullOrEmpty(((Rom)item).SHA1) ? 0 : 1); + _sha256Count += (String.IsNullOrEmpty(((Rom)item).SHA256) ? 0 : 1); + _sha384Count += (String.IsNullOrEmpty(((Rom)item).SHA384) ? 0 : 1); + _sha512Count += (String.IsNullOrEmpty(((Rom)item).SHA512) ? 0 : 1); + } + + _baddumpCount += (((Rom)item).ItemStatus == ItemStatus.BadDump ? 1 : 0); + _nodumpCount += (((Rom)item).ItemStatus == ItemStatus.Nodump ? 1 : 0); + break; + case ItemType.Sample: + break; + } + } + } + + /// + /// Remove from the internal statistics given a DatItem + /// + /// Item to remove info for + private void RemoveItemStatistics(DatItem item) + { + // No matter what the item is, we increate the count + lock (_statslock) + { + _count -= 1; + + // Now we do different things for each item type + + switch (item.Type) + { + case ItemType.Archive: + break; + case ItemType.BiosSet: + break; + case ItemType.Disk: + _diskCount -= 1; + if (((Disk)item).ItemStatus != ItemStatus.Nodump) + { + _md5Count -= (String.IsNullOrEmpty(((Disk)item).MD5) ? 0 : 1); + _sha1Count -= (String.IsNullOrEmpty(((Disk)item).SHA1) ? 0 : 1); + _sha256Count -= (String.IsNullOrEmpty(((Disk)item).SHA256) ? 0 : 1); + _sha384Count -= (String.IsNullOrEmpty(((Disk)item).SHA384) ? 0 : 1); + _sha512Count -= (String.IsNullOrEmpty(((Disk)item).SHA512) ? 0 : 1); + } + + _baddumpCount -= (((Disk)item).ItemStatus == ItemStatus.BadDump ? 1 : 0); + _nodumpCount -= (((Disk)item).ItemStatus == ItemStatus.Nodump ? 1 : 0); + break; + case ItemType.Release: + break; + case ItemType.Rom: + _romCount -= 1; + if (((Rom)item).ItemStatus != ItemStatus.Nodump) + { + _totalSize -= ((Rom)item).Size; + _crcCount -= (String.IsNullOrEmpty(((Rom)item).CRC) ? 0 : 1); + _md5Count -= (String.IsNullOrEmpty(((Rom)item).MD5) ? 0 : 1); + _sha1Count -= (String.IsNullOrEmpty(((Rom)item).SHA1) ? 0 : 1); + _sha256Count -= (String.IsNullOrEmpty(((Rom)item).SHA256) ? 0 : 1); + _sha384Count -= (String.IsNullOrEmpty(((Rom)item).SHA384) ? 0 : 1); + _sha512Count -= (String.IsNullOrEmpty(((Rom)item).SHA512) ? 0 : 1); + } + + _baddumpCount -= (((Rom)item).ItemStatus == ItemStatus.BadDump ? 1 : 0); + _nodumpCount -= (((Rom)item).ItemStatus == ItemStatus.Nodump ? 1 : 0); + break; + case ItemType.Sample: + break; + } + } + } + + /// + /// Reset all statistics + /// + private void ResetStatistics() + { + _count = 0; + _romCount = 0; + _diskCount = 0; + _totalSize = 0; + _crcCount = 0; + _md5Count = 0; + _sha1Count = 0; + _sha256Count = 0; + _sha384Count = 0; + _sha512Count = 0; + _baddumpCount = 0; + _nodumpCount = 0; + } + /// /// Recalculate the statistics for the Dat /// public void RecalculateStats() { // Wipe out any stats already there - RomCount = 0; - DiskCount = 0; - TotalSize = 0; - CRCCount = 0; - MD5Count = 0; - SHA1Count = 0; - SHA256Count = 0; - BaddumpCount = 0; - NodumpCount = 0; + ResetStatistics(); // If we have a blank Dat in any way, return if (this == null || Count == 0) @@ -57,41 +182,7 @@ namespace SabreTools.Library.Dats List items = this[key]; Parallel.ForEach(items, Globals.ParallelOptions, item => { - switch (item.Type) - { - case ItemType.Archive: - break; - case ItemType.BiosSet: - break; - case ItemType.Disk: - Disk disk = (Disk)item; - DiskCount += 1; - MD5Count += (String.IsNullOrEmpty(disk.MD5) ? 0 : 1); - SHA1Count += (String.IsNullOrEmpty(disk.SHA1) ? 0 : 1); - SHA256Count += (String.IsNullOrEmpty(disk.SHA256) ? 0 : 1); - SHA384Count += (String.IsNullOrEmpty(disk.SHA384) ? 0 : 1); - SHA512Count += (String.IsNullOrEmpty(disk.SHA512) ? 0 : 1); - BaddumpCount += (disk.ItemStatus == ItemStatus.BadDump ? 1 : 0); - NodumpCount += (disk.ItemStatus == ItemStatus.Nodump ? 1 : 0); - break; - case ItemType.Release: - break; - 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); - SHA256Count += (String.IsNullOrEmpty(rom.SHA256) ? 0 : 1); - SHA384Count += (String.IsNullOrEmpty(rom.SHA384) ? 0 : 1); - SHA512Count += (String.IsNullOrEmpty(rom.SHA512) ? 0 : 1); - BaddumpCount += (rom.ItemStatus == ItemStatus.BadDump ? 1 : 0); - NodumpCount += (rom.ItemStatus == ItemStatus.Nodump ? 1 : 0); - break; - case ItemType.Sample: - break; - } + AddItemStatistics(item); }); }); } @@ -115,32 +206,32 @@ namespace SabreTools.Library.Dats } BucketBy(SortedBy.Game, false /* mergeroms */, norename: true); - if (TotalSize < 0) + if (_totalSize < 0) { - TotalSize = Int64.MaxValue + TotalSize; + _totalSize = Int64.MaxValue + _totalSize; } // Log the results to screen - string results = @"For '" + FileName + @"': + string results = @"For '" + _fileName + @"': -------------------------------------------------- - Uncompressed size: " + Style.GetBytesReadable(TotalSize) + @" + Uncompressed size: " + Style.GetBytesReadable(_totalSize) + @" Games found: " + (game == -1 ? Keys.Count() : game) + @" - Roms found: " + RomCount + @" - Disks found: " + DiskCount + @" - Roms with CRC: " + CRCCount + @" - Roms with MD5: " + MD5Count + @" - Roms with SHA-1: " + SHA1Count + @" - Roms with SHA-256: " + SHA256Count + @" - Roms with SHA-384: " + SHA384Count + @" - Roms with SHA-512: " + SHA512Count + "\n"; + Roms found: " + _romCount + @" + Disks found: " + _diskCount + @" + Roms with CRC: " + _crcCount + @" + Roms with MD5: " + _md5Count + @" + Roms with SHA-1: " + _sha1Count + @" + Roms with SHA-256: " + _sha256Count + @" + Roms with SHA-384: " + _sha384Count + @" + Roms with SHA-512: " + _sha512Count + "\n"; if (baddumpCol) { - results += " Roms with BadDump status: " + BaddumpCount + "\n"; + results += " Roms with BadDump status: " + _baddumpCount + "\n"; } if (nodumpCol) { - results += " Roms with Nodump status: " + NodumpCount + "\n"; + results += " Roms with Nodump status: " + _nodumpCount + "\n"; } // For spacing between DATs @@ -152,25 +243,25 @@ namespace SabreTools.Library.Dats string line = ""; if (outputs.ContainsKey(StatDatFormat.None)) { - line = @"'" + FileName + @"': + line = @"'" + _fileName + @"': -------------------------------------------------- - Uncompressed size: " + Style.GetBytesReadable(TotalSize) + @" + Uncompressed size: " + Style.GetBytesReadable(_totalSize) + @" Games found: " + (game == -1 ? Keys.Count() : game) + @" - Roms found: " + RomCount + @" - Disks found: " + DiskCount + @" - Roms with CRC: " + CRCCount + @" - Roms with SHA-1: " + SHA1Count + @" - Roms with SHA-256: " + SHA256Count + @" - Roms with SHA-384: " + SHA384Count + @" - Roms with SHA-512: " + SHA512Count + "\n"; + Roms found: " + _romCount + @" + Disks found: " + _diskCount + @" + Roms with CRC: " + _crcCount + @" + Roms with SHA-1: " + _sha1Count + @" + Roms with SHA-256: " + _sha256Count + @" + Roms with SHA-384: " + _sha384Count + @" + Roms with SHA-512: " + _sha512Count + "\n"; if (baddumpCol) { - line += " Roms with BadDump status: " + BaddumpCount + "\n"; + line += " Roms with BadDump status: " + _baddumpCount + "\n"; } if (nodumpCol) { - line += " Roms with Nodump status: " + NodumpCount + "\n"; + line += " Roms with Nodump status: " + _nodumpCount + "\n"; } // For spacing between DATs @@ -180,25 +271,25 @@ namespace SabreTools.Library.Dats } if (outputs.ContainsKey(StatDatFormat.CSV)) { - line = "\"" + FileName + "\"," - + "\"" + TotalSize + "\"," + line = "\"" + _fileName + "\"," + + "\"" + _totalSize + "\"," + "\"" + (game == -1 ? Keys.Count() : game) + "\"," - + "\"" + RomCount + "\"," - + "\"" + DiskCount + "\"," - + "\"" + CRCCount + "\"," - + "\"" + MD5Count + "\"," - + "\"" + SHA1Count + "\"," - + "\"" + SHA256Count + "\"," - + "\"" + SHA384Count + "\"," - + "\"" + SHA512Count + "\""; + + "\"" + _romCount + "\"," + + "\"" + _diskCount + "\"," + + "\"" + _crcCount + "\"," + + "\"" + _md5Count + "\"," + + "\"" + _sha1Count + "\"," + + "\"" + _sha256Count + "\"," + + "\"" + _sha384Count + "\"," + + "\"" + _sha512Count + "\""; if (baddumpCol) { - line += ",\"" + BaddumpCount + "\""; + line += ",\"" + _baddumpCount + "\""; } if (nodumpCol) { - line += ",\"" + NodumpCount + "\""; + line += ",\"" + _nodumpCount + "\""; } line += "\n"; @@ -206,25 +297,25 @@ namespace SabreTools.Library.Dats } if (outputs.ContainsKey(StatDatFormat.HTML)) { - line = "\t\t\t" + HttpUtility.HtmlEncode(FileName.Remove(0, 5)) - : ">" + HttpUtility.HtmlEncode(FileName)) + "" - + "" + Style.GetBytesReadable(TotalSize) + "" + line = "\t\t\t" + HttpUtility.HtmlEncode(_fileName.Remove(0, 5)) + : ">" + HttpUtility.HtmlEncode(_fileName)) + "" + + "" + Style.GetBytesReadable(_totalSize) + "" + "" + (game == -1 ? Keys.Count() : game) + "" - + "" + RomCount + "" - + "" + DiskCount + "" - + "" + CRCCount + "" - + "" + MD5Count + "" - + "" + SHA1Count + "" - + "" + SHA256Count + ""; + + "" + _romCount + "" + + "" + _diskCount + "" + + "" + _crcCount + "" + + "" + _md5Count + "" + + "" + _sha1Count + "" + + "" + _sha256Count + ""; if (baddumpCol) { - line += "" + BaddumpCount + ""; + line += "" + _baddumpCount + ""; } if (nodumpCol) { - line += "" + NodumpCount + ""; + line += "" + _nodumpCount + ""; } line += "\n"; @@ -232,25 +323,25 @@ namespace SabreTools.Library.Dats } if (outputs.ContainsKey(StatDatFormat.TSV)) { - line = "\"" + FileName + "\"\t" - + "\"" + TotalSize + "\"\t" + line = "\"" + _fileName + "\"\t" + + "\"" + _totalSize + "\"\t" + "\"" + (game == -1 ? Keys.Count() : game) + "\"\t" - + "\"" + RomCount + "\"\t" - + "\"" + DiskCount + "\"\t" - + "\"" + CRCCount + "\"\t" - + "\"" + MD5Count + "\"\t" - + "\"" + SHA1Count + "\"\t" - + "\"" + SHA256Count + "\"\t" - + "\"" + SHA384Count + "\"\t" - + "\"" + SHA512Count + "\""; + + "\"" + _romCount + "\"\t" + + "\"" + _diskCount + "\"\t" + + "\"" + _crcCount + "\"\t" + + "\"" + _md5Count + "\"\t" + + "\"" + _sha1Count + "\"\t" + + "\"" + _sha256Count + "\"\t" + + "\"" + _sha384Count + "\"\t" + + "\"" + _sha512Count + "\""; if (baddumpCol) { - line += "\t\"" + BaddumpCount + "\""; + line += "\t\"" + _baddumpCount + "\""; } if (nodumpCol) { - line += "\t\"" + NodumpCount + "\""; + line += "\t\"" + _nodumpCount + "\""; } line += "\n"; @@ -334,6 +425,8 @@ namespace SabreTools.Library.Dats long totalMD5 = 0; long totalSHA1 = 0; long totalSHA256 = 0; + long totalSHA384 = 0; + long totalSHA512 = 0; long totalBaddump = 0; long totalNodump = 0; @@ -348,6 +441,8 @@ namespace SabreTools.Library.Dats long dirMD5 = 0; long dirSHA1 = 0; long dirSHA256 = 0; + long dirSHA384 = 0; + long dirSHA512 = 0; long dirBaddump = 0; long dirNodump = 0; @@ -366,16 +461,18 @@ namespace SabreTools.Library.Dats DatFile lastdirdat = new DatFile { - FileName = "DIR: " + HttpUtility.HtmlEncode(lastdir.Remove(0, basepath.Length + (basepath.Length == 0 ? 0 : 1))), - TotalSize = dirSize, - RomCount = dirRom, - DiskCount = dirDisk, - CRCCount = dirCRC, - MD5Count = dirMD5, - SHA1Count = dirSHA1, - SHA256Count = dirSHA256, - BaddumpCount = dirBaddump, - NodumpCount = dirNodump, + _fileName = "DIR: " + HttpUtility.HtmlEncode(lastdir.Remove(0, basepath.Length + (basepath.Length == 0 ? 0 : 1))), + _totalSize = dirSize, + _romCount = dirRom, + _diskCount = dirDisk, + _crcCount = dirCRC, + _md5Count = dirMD5, + _sha1Count = dirSHA1, + _sha256Count = dirSHA256, + _sha384Count = dirSHA384, + _sha512Count = dirSHA512, + _baddumpCount = dirBaddump, + _nodumpCount = dirNodump, }; lastdirdat.OutputStats(outputs, statDatFormat, game: dirGame, baddumpCol: baddumpCol, nodumpCol: nodumpCol); @@ -395,6 +492,8 @@ namespace SabreTools.Library.Dats dirMD5 = 0; dirSHA1 = 0; dirSHA256 = 0; + dirSHA384 = 0; + dirSHA512 = 0; dirBaddump = 0; dirNodump = 0; } @@ -422,6 +521,8 @@ namespace SabreTools.Library.Dats dirMD5 += datdata.MD5Count; dirSHA1 += datdata.SHA1Count; dirSHA256 += datdata.SHA256Count; + dirSHA384 += datdata.SHA384Count; + dirSHA512 += datdata.SHA512Count; dirBaddump += datdata.BaddumpCount; dirNodump += datdata.NodumpCount; @@ -434,6 +535,8 @@ namespace SabreTools.Library.Dats totalMD5 += datdata.MD5Count; totalSHA1 += datdata.SHA1Count; totalSHA256 += datdata.SHA256Count; + totalSHA384 += datdata.SHA384Count; + totalSHA512 += datdata.SHA512Count; totalBaddump += datdata.BaddumpCount; totalNodump += datdata.NodumpCount; @@ -448,16 +551,18 @@ namespace SabreTools.Library.Dats { DatFile dirdat = new DatFile { - FileName = "DIR: " + HttpUtility.HtmlEncode(lastdir.Remove(0, basepath.Length + (basepath.Length == 0 ? 0 : 1))), - TotalSize = dirSize, - RomCount = dirRom, - DiskCount = dirDisk, - CRCCount = dirCRC, - MD5Count = dirMD5, - SHA1Count = dirSHA1, - SHA256Count = dirSHA256, - BaddumpCount = dirBaddump, - NodumpCount = dirNodump, + _fileName = "DIR: " + HttpUtility.HtmlEncode(lastdir.Remove(0, basepath.Length + (basepath.Length == 0 ? 0 : 1))), + _totalSize = dirSize, + _romCount = dirRom, + _diskCount = dirDisk, + _crcCount = dirCRC, + _md5Count = dirMD5, + _sha1Count = dirSHA1, + _sha256Count = dirSHA256, + _sha384Count = dirSHA384, + _sha512Count = dirSHA512, + _baddumpCount = dirBaddump, + _nodumpCount = dirNodump, }; dirdat.OutputStats(outputs, statDatFormat, game: dirGame, baddumpCol: baddumpCol, nodumpCol: nodumpCol); @@ -478,21 +583,25 @@ namespace SabreTools.Library.Dats dirMD5 = 0; dirSHA1 = 0; dirSHA256 = 0; + dirSHA384 = 0; + dirSHA512 = 0; dirNodump = 0; // Output total DAT stats DatFile totaldata = new DatFile { - FileName = "DIR: All DATs", - TotalSize = totalSize, - RomCount = totalRom, - DiskCount = totalDisk, - CRCCount = totalCRC, - MD5Count = totalMD5, - SHA1Count = totalSHA1, - SHA256Count = totalSHA256, - BaddumpCount = totalBaddump, - NodumpCount = totalNodump, + _fileName = "DIR: All DATs", + _totalSize = totalSize, + _romCount = totalRom, + _diskCount = totalDisk, + _crcCount = totalCRC, + _md5Count = totalMD5, + _sha1Count = totalSHA1, + _sha256Count = totalSHA256, + _sha384Count = totalSHA384, + _sha512Count = totalSHA512, + _baddumpCount = totalBaddump, + _nodumpCount = totalNodump, }; totaldata.OutputStats(outputs, statDatFormat, game: totalGame, baddumpCol: baddumpCol, nodumpCol: nodumpCol);