mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Fix broken GetKeyDB and related
This commit is contained in:
@@ -246,7 +246,7 @@ namespace SabreTools.DatFiles
|
||||
}
|
||||
|
||||
// Get the key and add the file
|
||||
key = item.GetKey(ItemKey.Machine);
|
||||
key = GetBucketKey(item, _bucketedBy, lower: true, norename: true);
|
||||
|
||||
// If only adding statistics, we add an empty key for games and then just item stats
|
||||
if (statsOnly)
|
||||
@@ -644,6 +644,26 @@ namespace SabreTools.DatFiles
|
||||
return ItemKey.CRC;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get the bucketing key for a given item
|
||||
/// <param name="datItem">The current item</param>
|
||||
/// <param name="bucketBy">ItemKey value representing what key to get</param>
|
||||
/// <param name="lower">True if the key should be lowercased, false otherwise</param>
|
||||
/// <param name="norename">True if games should only be compared on game and file name, false if system and source are counted</param>
|
||||
/// </summary>
|
||||
private string GetBucketKey(DatItem datItem, ItemKey bucketBy, bool lower, bool norename)
|
||||
{
|
||||
if (datItem == null)
|
||||
return string.Empty;
|
||||
|
||||
// Treat NULL like machine
|
||||
if (bucketBy == ItemKey.NULL)
|
||||
bucketBy = ItemKey.Machine;
|
||||
|
||||
// Get the bucket key
|
||||
return datItem.GetKey(bucketBy, lower, norename);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Perform bucketing based on the item key provided
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user