Clean up more info instances

This commit is contained in:
Matt Nadareski
2020-09-18 01:50:44 -07:00
parent 817f1528cd
commit 7ed7107fd2
15 changed files with 73 additions and 90 deletions

View File

@@ -175,11 +175,10 @@ namespace SabreTools.Library.FileTypes
/// <summary>
/// Generate a list of DatItem objects from the header values in an archive
/// </summary>
/// <param name="omitFromScan">Hash representing the hashes that should be skipped</param>
/// <param name="date">True if entry dates should be included, false otherwise (default)</param>
/// <returns>List of DatItem objects representing the found data</returns>
/// <remarks>TODO: All instances of Hash.DeepHashes should be made into 0x0 eventually</remarks>
public override List<BaseFile> GetChildren(Hash omitFromScan = Hash.DeepHashes, bool date = false)
public override List<BaseFile> GetChildren(bool date = false)
{
List<BaseFile> found = new List<BaseFile>();
string gamename = Path.GetFileNameWithoutExtension(this.Filename);
@@ -189,8 +188,8 @@ namespace SabreTools.Library.FileTypes
SharpCompress.Archives.Rar.RarArchive ra = SharpCompress.Archives.Rar.RarArchive.Open(FileExtensions.TryOpenRead(this.Filename));
foreach (RarArchiveEntry entry in ra.Entries.Where(e => e != null && !e.IsDirectory))
{
// If secure hashes are disabled, do a quickscan
if (omitFromScan == Hash.SecureHashes)
// Perform a quickscan, if flagged to
if (QuickScan)
{
found.Add(new BaseFile
{
@@ -207,7 +206,6 @@ namespace SabreTools.Library.FileTypes
{
Stream entryStream = entry.OpenEntryStream();
BaseFile rarEntryRom = entryStream.GetInfo(size: entry.Size);
rarEntryRom.RemoveHashes(omitFromScan);
rarEntryRom.Filename = entry.Key;
rarEntryRom.Parent = gamename;
rarEntryRom.Date = entry.LastModifiedTime?.ToString("yyyy/MM/dd hh:mm:ss");