mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Reduce who cares about date
This commit is contained in:
@@ -153,10 +153,8 @@ namespace SabreTools.Library.FileTypes
|
||||
/// <summary>
|
||||
/// Generate a list of DatItem objects from the header values in an archive
|
||||
/// </summary>
|
||||
/// <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 abstract List<BaseFile> GetChildren(bool date = false);
|
||||
public override abstract List<BaseFile> GetChildren();
|
||||
|
||||
/// <summary>
|
||||
/// Generate a list of empty folders in an archive
|
||||
|
||||
@@ -256,16 +256,15 @@ namespace SabreTools.Library.FileTypes
|
||||
/// <summary>
|
||||
/// Generate a list of immediate children from the current folder
|
||||
/// </summary>
|
||||
/// <param name="date">True if entry dates should be included, false otherwise (default)</param>
|
||||
/// <returns>List of BaseFile objects representing the found data</returns>
|
||||
public virtual List<BaseFile> GetChildren(bool date = false)
|
||||
public virtual List<BaseFile> GetChildren()
|
||||
{
|
||||
if (_children == null || _children.Count == 0)
|
||||
{
|
||||
_children = new List<BaseFile>();
|
||||
foreach (string file in Directory.EnumerateFiles(this.Filename, "*", SearchOption.TopDirectoryOnly))
|
||||
{
|
||||
BaseFile nf = FileExtensions.GetInfo(file, date: date);
|
||||
BaseFile nf = FileExtensions.GetInfo(file);
|
||||
_children.Add(nf);
|
||||
}
|
||||
|
||||
|
||||
@@ -5,7 +5,6 @@ using System.Linq;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
using SabreTools.Library.Data;
|
||||
using SabreTools.Library.DatFiles;
|
||||
using SabreTools.Library.DatItems;
|
||||
using SabreTools.Library.IO;
|
||||
using SabreTools.Library.Tools;
|
||||
@@ -189,10 +188,8 @@ namespace SabreTools.Library.FileTypes
|
||||
/// <summary>
|
||||
/// Generate a list of DatItem objects from the header values in an archive
|
||||
/// </summary>
|
||||
/// <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(bool date = false)
|
||||
public override List<BaseFile> GetChildren()
|
||||
{
|
||||
if (_children == null || _children.Count == 0)
|
||||
{
|
||||
@@ -235,7 +232,7 @@ namespace SabreTools.Library.FileTypes
|
||||
BaseFile gzipEntryRom = gzstream.GetInfo();
|
||||
gzipEntryRom.Filename = gz.Filename(0);
|
||||
gzipEntryRom.Parent = gamename;
|
||||
gzipEntryRom.Date = (date && gz.TimeStamp > 0 ? gz.TimeStamp.ToString() : null);
|
||||
gzipEntryRom.Date = (gz.TimeStamp > 0 ? gz.TimeStamp.ToString() : null);
|
||||
_children.Add(gzipEntryRom);
|
||||
gzstream.Dispose();
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using SabreTools.Library.DatFiles;
|
||||
using SabreTools.Library.DatItems;
|
||||
|
||||
namespace SabreTools.Library.FileTypes
|
||||
@@ -78,10 +77,8 @@ namespace SabreTools.Library.FileTypes
|
||||
/// <summary>
|
||||
/// Generate a list of DatItem objects from the header values in an archive
|
||||
/// </summary>
|
||||
/// <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(bool date = false)
|
||||
public override List<BaseFile> GetChildren()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using SabreTools.Library.DatFiles;
|
||||
using SabreTools.Library.DatItems;
|
||||
|
||||
namespace SabreTools.Library.FileTypes
|
||||
@@ -78,10 +77,8 @@ namespace SabreTools.Library.FileTypes
|
||||
/// <summary>
|
||||
/// Generate a list of DatItem objects from the header values in an archive
|
||||
/// </summary>
|
||||
/// <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(bool date = false)
|
||||
public override List<BaseFile> GetChildren()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
using SabreTools.Library.Data;
|
||||
using SabreTools.Library.DatFiles;
|
||||
using SabreTools.Library.DatItems;
|
||||
using SabreTools.Library.IO;
|
||||
using SharpCompress.Archives;
|
||||
@@ -175,10 +174,8 @@ namespace SabreTools.Library.FileTypes
|
||||
/// <summary>
|
||||
/// Generate a list of DatItem objects from the header values in an archive
|
||||
/// </summary>
|
||||
/// <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(bool date = false)
|
||||
public override List<BaseFile> GetChildren()
|
||||
{
|
||||
List<BaseFile> found = new List<BaseFile>();
|
||||
string gamename = Path.GetFileNameWithoutExtension(this.Filename);
|
||||
@@ -196,7 +193,7 @@ namespace SabreTools.Library.FileTypes
|
||||
Filename = entry.Key,
|
||||
Size = entry.Size,
|
||||
CRC = BitConverter.GetBytes(entry.Crc),
|
||||
Date = (date && entry.LastModifiedTime != null ? entry.LastModifiedTime?.ToString("yyyy/MM/dd hh:mm:ss") : null),
|
||||
Date = (entry.LastModifiedTime != null ? entry.LastModifiedTime?.ToString("yyyy/MM/dd hh:mm:ss") : null),
|
||||
|
||||
Parent = gamename,
|
||||
});
|
||||
|
||||
@@ -4,7 +4,6 @@ using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
using SabreTools.Library.Data;
|
||||
using SabreTools.Library.DatFiles;
|
||||
using SabreTools.Library.DatItems;
|
||||
using SabreTools.Library.IO;
|
||||
using SabreTools.Library.Tools;
|
||||
@@ -259,10 +258,8 @@ namespace SabreTools.Library.FileTypes
|
||||
/// <summary>
|
||||
/// Generate a list of DatItem objects from the header values in an archive
|
||||
/// </summary>
|
||||
/// <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(bool date = false)
|
||||
public override List<BaseFile> GetChildren()
|
||||
{
|
||||
List<BaseFile> found = new List<BaseFile>();
|
||||
string gamename = Path.GetFileNameWithoutExtension(this.Filename);
|
||||
|
||||
@@ -4,7 +4,6 @@ using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
using SabreTools.Library.Data;
|
||||
using SabreTools.Library.DatFiles;
|
||||
using SabreTools.Library.DatItems;
|
||||
using SabreTools.Library.IO;
|
||||
using SabreTools.Library.Tools;
|
||||
@@ -180,10 +179,8 @@ namespace SabreTools.Library.FileTypes
|
||||
/// <summary>
|
||||
/// Generate a list of DatItem objects from the header values in an archive
|
||||
/// </summary>
|
||||
/// <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(bool date = false)
|
||||
public override List<BaseFile> GetChildren()
|
||||
{
|
||||
List<BaseFile> found = new List<BaseFile>();
|
||||
string gamename = Path.GetFileNameWithoutExtension(this.Filename);
|
||||
@@ -201,7 +198,7 @@ namespace SabreTools.Library.FileTypes
|
||||
Filename = entry.Key,
|
||||
Size = entry.Size,
|
||||
CRC = BitConverter.GetBytes(entry.Crc),
|
||||
Date = (date && entry.LastModifiedTime != null ? entry.LastModifiedTime?.ToString("yyyy/MM/dd hh:mm:ss") : null),
|
||||
Date = (entry.LastModifiedTime != null ? entry.LastModifiedTime?.ToString("yyyy/MM/dd hh:mm:ss") : null),
|
||||
|
||||
Parent = gamename,
|
||||
});
|
||||
|
||||
@@ -4,7 +4,6 @@ using System.IO;
|
||||
using System.Text.RegularExpressions;
|
||||
|
||||
using SabreTools.Library.Data;
|
||||
using SabreTools.Library.DatFiles;
|
||||
using SabreTools.Library.DatItems;
|
||||
using SabreTools.Library.IO;
|
||||
using SabreTools.Library.Tools;
|
||||
@@ -181,10 +180,8 @@ namespace SabreTools.Library.FileTypes
|
||||
/// <summary>
|
||||
/// Generate a list of DatItem objects from the header values in an archive
|
||||
/// </summary>
|
||||
/// <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(bool date = false)
|
||||
public override List<BaseFile> GetChildren()
|
||||
{
|
||||
if (_children == null || _children.Count == 0)
|
||||
{
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using SabreTools.Library.DatFiles;
|
||||
using SabreTools.Library.DatItems;
|
||||
|
||||
namespace SabreTools.Library.FileTypes
|
||||
@@ -78,10 +77,8 @@ namespace SabreTools.Library.FileTypes
|
||||
/// <summary>
|
||||
/// Generate a list of DatItem objects from the header values in an archive
|
||||
/// </summary>
|
||||
/// <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(bool date = false)
|
||||
public override List<BaseFile> GetChildren()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ using System.IO;
|
||||
using System.Linq;
|
||||
|
||||
using SabreTools.Library.Data;
|
||||
using SabreTools.Library.DatFiles;
|
||||
using SabreTools.Library.DatItems;
|
||||
using SabreTools.Library.IO;
|
||||
using SabreTools.Library.Tools;
|
||||
@@ -260,10 +259,8 @@ namespace SabreTools.Library.FileTypes
|
||||
/// <summary>
|
||||
/// Generate a list of DatItem objects from the header values in an archive
|
||||
/// </summary>
|
||||
/// <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(bool date = false)
|
||||
public override List<BaseFile> GetChildren()
|
||||
{
|
||||
List<BaseFile> found = new List<BaseFile>();
|
||||
string gamename = Path.GetFileNameWithoutExtension(this.Filename);
|
||||
@@ -312,7 +309,7 @@ namespace SabreTools.Library.FileTypes
|
||||
Filename = newname,
|
||||
Size = newsize,
|
||||
CRC = newcrc,
|
||||
Date = (date ? convertedDate : null),
|
||||
Date = convertedDate,
|
||||
|
||||
Parent = gamename,
|
||||
});
|
||||
@@ -324,7 +321,7 @@ namespace SabreTools.Library.FileTypes
|
||||
zipEntryRom.Filename = zf.Filename(i);
|
||||
zipEntryRom.Parent = gamename;
|
||||
string convertedDate = zf.LastModified(i).ToString("yyyy/MM/dd hh:mm:ss");
|
||||
zipEntryRom.Date = (date ? convertedDate : null);
|
||||
zipEntryRom.Date = convertedDate;
|
||||
found.Add(zipEntryRom);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,8 +2,6 @@
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
|
||||
using SabreTools.Library.Data;
|
||||
using SabreTools.Library.DatFiles;
|
||||
using SabreTools.Library.DatItems;
|
||||
|
||||
namespace SabreTools.Library.FileTypes
|
||||
@@ -79,10 +77,8 @@ namespace SabreTools.Library.FileTypes
|
||||
/// <summary>
|
||||
/// Generate a list of DatItem objects from the header values in an archive
|
||||
/// </summary>
|
||||
/// <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(bool date = false)
|
||||
public override List<BaseFile> GetChildren()
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user