Swap order of file GetInfo method params

This commit is contained in:
Matt Nadareski
2025-01-05 22:19:42 -05:00
parent 5d25a09785
commit 285a9f0ba6
2 changed files with 4 additions and 4 deletions

View File

@@ -406,7 +406,7 @@ namespace SabreTools.DatTools
{ {
logger.Verbose($"'{Path.GetFileName(item)}' treated like a file"); logger.Verbose($"'{Path.GetFileName(item)}' treated like a file");
var header = datFile.Header.GetStringFieldValue(Models.Metadata.Header.HeaderKey); var header = datFile.Header.GetStringFieldValue(Models.Metadata.Header.HeaderKey);
BaseFile? baseFile = FileTypeTool.GetInfo(item, header, _hashes); BaseFile? baseFile = FileTypeTool.GetInfo(item, _hashes, header);
DatItem? datItem = DatItemTool.CreateDatItem(baseFile, asFile); DatItem? datItem = DatItemTool.CreateDatItem(baseFile, asFile);
if (datItem != null) if (datItem != null)
ProcessFileHelper(datFile, item, datItem, basePath, string.Empty); ProcessFileHelper(datFile, item, datItem, basePath, string.Empty);

View File

@@ -21,16 +21,16 @@ namespace SabreTools.FileTypes
/// <param name="hashes">Hashes to include in the information</param> /// <param name="hashes">Hashes to include in the information</param>
/// <returns>Populated BaseFile object if success, empty on error</returns> /// <returns>Populated BaseFile object if success, empty on error</returns>
public static BaseFile GetInfo(string input, HashType[] hashes) public static BaseFile GetInfo(string input, HashType[] hashes)
=> GetInfo(input, header: null, hashes); => GetInfo(input, hashes, header: null);
/// <summary> /// <summary>
/// Retrieve file information for a single file /// Retrieve file information for a single file
/// </summary> /// </summary>
/// <param name="input">Filename to get information from</param> /// <param name="input">Filename to get information from</param>
/// <param name="header">Populated string representing the name of the skipper to use, a blank string to use the first available checker, null otherwise</param>
/// <param name="hashes">Hashes to include in the information</param> /// <param name="hashes">Hashes to include in the information</param>
/// <param name="header">Populated string representing the name of the skipper to use, a blank string to use the first available checker, null otherwise</param>
/// <returns>Populated BaseFile object if success, empty on error</returns> /// <returns>Populated BaseFile object if success, empty on error</returns>
public static BaseFile GetInfo(string input, string? header, HashType[] hashes) public static BaseFile GetInfo(string input, HashType[] hashes, string? header)
{ {
// Add safeguard if file doesn't exist // Add safeguard if file doesn't exist
if (!File.Exists(input)) if (!File.Exists(input))