diff --git a/SabreTools.Helper/Data/Build.cs b/SabreTools.Helper/Data/Build.cs index ab14b344..f7f11326 100644 --- a/SabreTools.Helper/Data/Build.cs +++ b/SabreTools.Helper/Data/Build.cs @@ -380,6 +380,7 @@ namespace SabreTools.Helper.Data helptext.Add(" -dat= Input DAT to verify against"); helptext.Add(" -t=, --temp= Set the temporary directory to use"); helptext.Add(" -ho, --hash-only Check files by hash only"); + helptext.Add(" -qs, --quick Enable quick scanning of archives"); helptext.Add(" -h=, --header= Set a header skipper to use, blank means all"); // Additional Notes diff --git a/SabreTools.Helper/Dats/Partials/DatFile.Rebuild.cs b/SabreTools.Helper/Dats/Partials/DatFile.Rebuild.cs index b5587469..4da38216 100644 --- a/SabreTools.Helper/Dats/Partials/DatFile.Rebuild.cs +++ b/SabreTools.Helper/Dats/Partials/DatFile.Rebuild.cs @@ -469,10 +469,11 @@ namespace SabreTools.Helper.Dats /// List of input directories to compare against /// Temporary directory for archive extraction /// True if only hashes should be checked, false for full file information + /// True to enable external scanning of archives, false otherwise /// Populated string representing the name of the skipper to use, a blank string to use the first available checker, null otherwise /// Logger object for file and console output /// True if verification was a success, false otherwise - public bool VerifyDirectory(List inputs, string tempDir, bool hashOnly, string headerToCheckAgainst, Logger logger) + public bool VerifyDirectory(List inputs, string tempDir, bool hashOnly, bool quickScan, string headerToCheckAgainst, Logger logger) { // Check the temp directory exists if (String.IsNullOrEmpty(tempDir)) @@ -500,7 +501,7 @@ namespace SabreTools.Helper.Dats logger.User("Processing files:\n"); foreach (string input in inputs) { - PopulateFromDir(input, false /* noMD5 */, false /* noSHA1 */, true /* bare */, false /* archivesAsFiles */, + PopulateFromDir(input, quickScan /* noMD5 */, quickScan /* noSHA1 */, true /* bare */, false /* archivesAsFiles */, true /* enableGzip */, false /* addBlanks */, false /* addDate */, tempDir /* tempDir */, false /* copyFiles */, headerToCheckAgainst, 4 /* maxDegreeOfParallelism */, logger); } diff --git a/SabreTools.Helper/README.1ST b/SabreTools.Helper/README.1ST index d497698a..36ecf43c 100644 --- a/SabreTools.Helper/README.1ST +++ b/SabreTools.Helper/README.1ST @@ -906,6 +906,12 @@ Options: This allows verification of (possibly) incorrectly named folders and sets to be verified without worrying about the proper set structure to be there. + -qs, --quick Enable quick scanning of archives + For all archives, if this flag is enabled, it will only use the header information + to get the archive entries' file information. The upside to this is that it is much + quicker than extracting all files to the temp folder. On the downside, it can only + get the CRC and size from most archive formats, leading to possible issues. + -h=, --header= Remove headers from hash calculations If this is set, then all files that have copier headers that are detected will have them removed from the hash calculation. This will allow for a headered collection diff --git a/SabreTools/Partials/SabreTools.Inits.cs b/SabreTools/Partials/SabreTools.Inits.cs index 04e515ec..4a5b56e5 100644 --- a/SabreTools/Partials/SabreTools.Inits.cs +++ b/SabreTools/Partials/SabreTools.Inits.cs @@ -790,8 +790,9 @@ namespace SabreTools /// Input directories to compare against /// Temporary directory for archive extraction /// True if only hashes should be checked, false for full file information + /// True to enable external scanning of archives, false otherwise /// Populated string representing the name of the skipper to use, a blank string to use the first available checker, null otherwise - private static void InitVerify(List datfiles, List inputs, string tempDir, bool hashOnly, string headerToCheckAgainst) + private static void InitVerify(List datfiles, List inputs, string tempDir, bool hashOnly, bool quickScan, string headerToCheckAgainst) { // Get the archive scanning level ArchiveScanLevel asl = ArchiveTools.GetArchiveScanLevelFromNumbers(1, 1, 1, 1); @@ -807,7 +808,7 @@ namespace SabreTools } _logger.User("Populating complete in " + DateTime.Now.Subtract(start).ToString(@"hh\:mm\:ss\.fffff")); - datdata.VerifyDirectory(inputs, tempDir, hashOnly, headerToCheckAgainst, _logger); + datdata.VerifyDirectory(inputs, tempDir, hashOnly, quickScan, headerToCheckAgainst, _logger); } #endregion diff --git a/SabreTools/SabreTools.cs b/SabreTools/SabreTools.cs index e5488d94..09cdbddf 100644 --- a/SabreTools/SabreTools.cs +++ b/SabreTools/SabreTools.cs @@ -1109,7 +1109,7 @@ namespace SabreTools // If we're using the verifier else if (verify) { - InitVerify(datfiles, inputs, tempDir, hashOnly, header); + InitVerify(datfiles, inputs, tempDir, hashOnly, quickScan, header); } // If nothing is set, show the help