Add RecalculateStats passthrough

This commit is contained in:
Matt Nadareski
2025-01-14 15:46:42 -05:00
parent f5b97ab0dc
commit 616aea983b
2 changed files with 15 additions and 3 deletions

View File

@@ -301,6 +301,19 @@ namespace SabreTools.DatFiles
#endregion
#region Item Dictionary Passthrough - Bucketing
/// <summary>
/// Recalculate the statistics for the Dat
/// </summary>
public void RecalculateStats()
{
Items.RecalculateStats();
ItemsDB.RecalculateStats();
}
#endregion
#region Parsing
/// <summary>

View File

@@ -136,7 +136,7 @@ namespace SabreTools.DatTools
long romCount = datFile.DatStatistics.GetItemCount(ItemType.Rom);
if (diskCount + mediaCount + romCount == 0)
datFile.Items.RecalculateStats();
datFile.RecalculateStats();
datFile.BucketBy(ItemKey.Machine, DedupeType.None, norename: true);
@@ -214,8 +214,7 @@ namespace SabreTools.DatTools
private static bool HasWritable(DatFile datFile)
{
// Force a statistics recheck, just in case
datFile.Items.RecalculateStats();
datFile.ItemsDB.RecalculateStats();
datFile.RecalculateStats();
// If there's nothing there, abort
if (datFile.DatStatistics.TotalCount == 0)