From 4dab96eddd08cc7726c82f2c1acfa68e01d1d97e Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Thu, 26 Jan 2017 15:54:02 -0800 Subject: [PATCH] [DatFile] Remove set rebuilding mode --- RombaSharp/Partials/RombaSharp_Inits.cs | 4 +- SabreTools.Helper/Data/Build.cs | 1 - .../Dats/Partials/DatFile.Rebuild.cs | 473 +----------------- SabreTools.Helper/README.1ST | 7 - SabreTools/Partials/SabreTools.Inits.cs | 5 +- SabreTools/SabreTools.cs | 7 +- 6 files changed, 14 insertions(+), 483 deletions(-) diff --git a/RombaSharp/Partials/RombaSharp_Inits.cs b/RombaSharp/Partials/RombaSharp_Inits.cs index a15fe49c..2d74bcbf 100644 --- a/RombaSharp/Partials/RombaSharp_Inits.cs +++ b/RombaSharp/Partials/RombaSharp_Inits.cs @@ -174,7 +174,7 @@ namespace SabreTools // Create the sorting object to use and rebuild the needed files ArchiveScanLevel asl = ArchiveTools.GetArchiveScanLevelFromNumbers((onlyNeeded ? 0 : 1), (onlyNeeded ? 0 : 1), (onlyNeeded ? 0 : 1), (onlyNeeded ? 0 : 1)); - need.RebuildToOutput(onlyDirs, _depots.Keys.ToList()[0], _tmpdir, false /*set*/, false /*quickScan*/, false /*date*/, + need.RebuildToOutput(onlyDirs, _depots.Keys.ToList()[0], _tmpdir, false /*quickScan*/, false /*date*/, false /*delete*/, false /*inverse*/, OutputFormat.TorrentGzip, true /*romba*/, asl, false /*updateDat*/, null /*headerToCheckAgainst*/, 4 /*maxDegreeOfParallelism*/, _logger); } @@ -214,7 +214,7 @@ namespace SabreTools // Now scan all of those depots and rebuild ArchiveScanLevel asl = ArchiveTools.GetArchiveScanLevelFromNumbers(1, 1, 1, 1); - datFile.RebuildToOutput(onlineDepots, outputFolder, _tmpdir, true /*set*/, true /*quickscan*/, false /*date*/, + datFile.RebuildToOutput(onlineDepots, outputFolder, _tmpdir, true /*quickscan*/, false /*date*/, false /*delete*/, false /*inverse*/, (copy ? OutputFormat.TorrentGzip : OutputFormat.TorrentZip), copy, asl, false /*updateDat*/, null /*headerToCheckAgainst*/, 4 /*maxDegreeOfParallelism*/, _logger); } diff --git a/SabreTools.Helper/Data/Build.cs b/SabreTools.Helper/Data/Build.cs index 647d4117..1b3a80e0 100644 --- a/SabreTools.Helper/Data/Build.cs +++ b/SabreTools.Helper/Data/Build.cs @@ -218,7 +218,6 @@ namespace SabreTools.Helper.Data helptext.Add(" -dat= Input DAT to rebuild against"); helptext.Add(" -out= Output directory"); helptext.Add(" -t=, --temp= Set the temporary directory to use"); - helptext.Add(" -set Enable set-creation mode (lower I/O, slower)"); helptext.Add(" -del, --delete Delete input files [DO NOT USE]"); helptext.Add(" -in, --inverse Rebuild only files not in DAT"); helptext.Add(" -qs, --quick Enable quick scanning of archives"); diff --git a/SabreTools.Helper/Dats/Partials/DatFile.Rebuild.cs b/SabreTools.Helper/Dats/Partials/DatFile.Rebuild.cs index 01dd2645..a3e70cd0 100644 --- a/SabreTools.Helper/Dats/Partials/DatFile.Rebuild.cs +++ b/SabreTools.Helper/Dats/Partials/DatFile.Rebuild.cs @@ -28,7 +28,6 @@ namespace SabreTools.Helper.Dats /// List of input files/folders to check /// Output directory to use to build to /// Temporary directory for archive extraction - /// True to enable set building output, false otherwise /// True to enable external scanning of archives, false otherwise /// True if the date from the DAT should be used if available, false otherwise /// True if input files should be deleted, false otherwise @@ -40,7 +39,7 @@ namespace SabreTools.Helper.Dats /// 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 rebuilding was a success, false otherwise - public bool RebuildToOutput(List inputs, string outDir, string tempDir, bool set, bool quickScan, bool date, + public bool RebuildToOutput(List inputs, string outDir, string tempDir, bool quickScan, bool date, bool delete, bool inverse, OutputFormat outputFormat, bool romba, ArchiveScanLevel archiveScanLevel, bool updateDat, string headerToCheckAgainst, int maxDegreeOfParallelism, Logger logger) { @@ -83,44 +82,6 @@ namespace SabreTools.Helper.Dats bool success = true; - // Now choose the correct rebuilder - if (set) - { - success = RebuildToOutputWithSets(inputs, outDir, tempDir, quickScan, date, delete, inverse, - outputFormat, romba, archiveScanLevel, updateDat, headerToCheckAgainst, maxDegreeOfParallelism, logger); - } - else - { - success = RebuildToOutputWithoutSets(inputs, outDir, tempDir, quickScan, date, delete, inverse, - outputFormat, romba, archiveScanLevel, updateDat, headerToCheckAgainst, maxDegreeOfParallelism, logger); - } - - return success; - } - - /// - /// Rebuild sets using CMP-style linear rebuilding - /// - /// List of input files/folders to check - /// Output directory to use to build to - /// Temporary directory for archive extraction - /// True to enable external scanning of archives, false otherwise - /// True if the date from the DAT should be used if available, false otherwise - /// True if input files should be deleted, false otherwise - /// True if the DAT should be used as a filter instead of a template, false otherwise - /// Output format that files should be written to - /// True if files should be output in Romba depot folders, false otherwise - /// ArchiveScanLevel representing the archive handling levels - /// True if the updated DAT should be output, 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 rebuilding was a success, false otherwise - private bool RebuildToOutputWithoutSets(List inputs, string outDir, string tempDir, bool quickScan, bool date, - bool delete, bool inverse, OutputFormat outputFormat, bool romba, ArchiveScanLevel archiveScanLevel, bool updateDat, - string headerToCheckAgainst, int maxDegreeOfParallelism, Logger logger) - { - bool success = true; - #region Rebuild from sources in order switch (outputFormat) @@ -159,7 +120,7 @@ namespace SabreTools.Helper.Dats if (File.Exists(input)) { logger.User("Checking file: '" + input + "'"); - RebuildToOutputWithoutSetsHelper(input, outDir, tempDir, quickScan, date, delete, inverse, + RebuildToOutputHelper(input, outDir, tempDir, quickScan, date, delete, inverse, outputFormat, romba, archiveScanLevel, updateDat, headerToCheckAgainst, maxDegreeOfParallelism, logger); } @@ -170,7 +131,7 @@ namespace SabreTools.Helper.Dats foreach (string file in Directory.EnumerateFiles(input, "*", SearchOption.AllDirectories)) { logger.User("Checking file: '" + file + "'"); - RebuildToOutputWithoutSetsHelper(file, outDir, tempDir, quickScan, date, delete, inverse, + RebuildToOutputHelper(file, outDir, tempDir, quickScan, date, delete, inverse, outputFormat, romba, archiveScanLevel, updateDat, headerToCheckAgainst, maxDegreeOfParallelism, logger); } } @@ -199,7 +160,7 @@ namespace SabreTools.Helper.Dats /// True if the updated DAT should be output, 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 - private void RebuildToOutputWithoutSetsHelper(string file, string outDir, string tempDir, bool quickScan, bool date, + private void RebuildToOutputHelper(string file, string outDir, string tempDir, bool quickScan, bool date, bool delete, bool inverse, OutputFormat outputFormat, bool romba, ArchiveScanLevel archiveScanLevel, bool updateDat, string headerToCheckAgainst, int maxDegreeOfParallelism, Logger logger) { @@ -225,7 +186,7 @@ namespace SabreTools.Helper.Dats if (shouldExternalProcess) { Rom rom = FileTools.GetFileInfo(file, logger, noMD5: quickScan, noSHA1: quickScan, header: headerToCheckAgainst); - usedExternally = RebuildToOutputWithoutSetsIndividual(rom, file, outDir, tempSubDir, date, inverse, outputFormat, + usedExternally = RebuildToOutputIndividual(rom, file, outDir, tempSubDir, date, inverse, outputFormat, romba, updateDat, false /* isZip */, headerToCheckAgainst, logger); } @@ -240,7 +201,7 @@ namespace SabreTools.Helper.Dats foreach (Rom rom in extracted) { - usedInternally &= RebuildToOutputWithoutSetsIndividual(rom, file, outDir, tempSubDir, date, inverse, outputFormat, + usedInternally &= RebuildToOutputIndividual(rom, file, outDir, tempSubDir, date, inverse, outputFormat, romba, updateDat, true /* isZip */, headerToCheckAgainst, logger); } } @@ -257,7 +218,7 @@ namespace SabreTools.Helper.Dats foreach (string entry in extracted) { Rom rom = FileTools.GetFileInfo(entry, logger, noMD5: quickScan, noSHA1: quickScan, header: headerToCheckAgainst); - RebuildToOutputWithoutSetsIndividual(rom, file, outDir, tempSubDir, date, inverse, outputFormat, + RebuildToOutputIndividual(rom, file, outDir, tempSubDir, date, inverse, outputFormat, romba, updateDat, false /* isZip */, headerToCheckAgainst, logger); // Now we want to remove the file from the temp directory @@ -278,7 +239,7 @@ namespace SabreTools.Helper.Dats else if (File.Exists(file)) { Rom rom = FileTools.GetFileInfo(file, logger, noMD5: quickScan, noSHA1: quickScan, header: headerToCheckAgainst); - usedExternally = RebuildToOutputWithoutSetsIndividual(rom, file, outDir, tempSubDir, date, inverse, outputFormat, + usedExternally = RebuildToOutputIndividual(rom, file, outDir, tempSubDir, date, inverse, outputFormat, romba, updateDat, false /* isZip */, headerToCheckAgainst, logger); } } @@ -318,7 +279,7 @@ namespace SabreTools.Helper.Dats /// 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 the file was able to be rebuilt, false otherwise - private bool RebuildToOutputWithoutSetsIndividual(Rom rom, string file, string outDir, string tempDir, bool date, + private bool RebuildToOutputIndividual(Rom rom, string file, string outDir, string tempDir, bool date, bool inverse, OutputFormat outputFormat, bool romba, bool updateDat, bool isZip, string headerToCheckAgainst, Logger logger) { // Set the output value @@ -413,422 +374,6 @@ namespace SabreTools.Helper.Dats return rebuilt; } - /// - /// Rebuild sets using RV-style set rebuilding - /// - /// List of input files/folders to check - /// Output directory to use to build to - /// Temporary directory for archive extraction - /// True to enable external scanning of archives, false otherwise - /// True if the date from the DAT should be used if available, false otherwise - /// True if input files should be deleted, false otherwise - /// True if the DAT should be used as a filter instead of a template, false otherwise - /// Output format that files should be written to - /// True if files should be output in Romba depot folders, false otherwise - /// ArchiveScanLevel representing the archive handling levels - /// True if the updated DAT should be output, 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 rebuilding was a success, false otherwise - private bool RebuildToOutputWithSets(List inputs, string outDir, string tempDir, bool quickScan, bool date, - bool delete, bool inverse, OutputFormat outputFormat, bool romba, ArchiveScanLevel archiveScanLevel, bool updateDat, - string headerToCheckAgainst, int maxDegreeOfParallelism, Logger logger) - { - bool success = true; - DatFile matched = new DatFile(); - List files = new List(); - - #region Retrieve a list of all files - - logger.User("Retrieving list all files from input"); - DateTime start = DateTime.Now; - - // Create a list of just files from inputs - Parallel.ForEach(inputs, - new ParallelOptions { MaxDegreeOfParallelism = maxDegreeOfParallelism, }, - input => { - if (File.Exists(input)) - { - logger.Verbose("File found: '" + input + "'"); - files.Add(Path.GetFullPath(input)); - } - else if (Directory.Exists(input)) - { - logger.Verbose("Directory found: '" + input + "'"); - Parallel.ForEach(Directory.EnumerateFiles(input, "*", SearchOption.AllDirectories), - new ParallelOptions { MaxDegreeOfParallelism = maxDegreeOfParallelism, }, - file => - { - logger.Verbose("File found: '" + file + "'"); - files.Add(Path.GetFullPath(file)); - }); - } - else - { - logger.Error("'" + input + "' is not a file or directory!"); - } - }); - logger.User("Retrieving complete in: " + DateTime.Now.Subtract(start).ToString(@"hh\:mm\:ss\.fffff")); - - #endregion - - DatFile current = new DatFile(); - Dictionary fileToSkipperRule = new Dictionary(); - - #region Create a dat from input files - - logger.User("Getting hash information for all input files"); - start = DateTime.Now; - - // Now that we have a list of just files, we get a DAT from the input files - Parallel.ForEach(files, - new ParallelOptions { MaxDegreeOfParallelism = maxDegreeOfParallelism }, - file => - { - // If we somehow have a null filename, return - if (file == null) - { - return; - } - - // Define the temporary directory - string tempSubDir = Path.GetFullPath(Path.Combine(tempDir, Path.GetRandomFileName())) + Path.DirectorySeparatorChar; - - // Get the required scanning level for the file - bool shouldExternalProcess = false; - bool shouldInternalProcess = false; - ArchiveTools.GetInternalExternalProcess(file, archiveScanLevel, logger, out shouldExternalProcess, out shouldInternalProcess); - - // If we're supposed to scan the file externally - if (shouldExternalProcess) - { - Rom rom = FileTools.GetFileInfo(file, logger, noMD5: quickScan, noSHA1: quickScan, header: headerToCheckAgainst); - rom.Name = Path.GetFullPath(file); - current.Add(rom.Size + "-" + rom.CRC, rom); - - // If we had a header, we want the full file information too - if (headerToCheckAgainst != null) - { - rom = FileTools.GetFileInfo(file, logger, noMD5: quickScan, noSHA1: quickScan); - rom.Name = Path.GetFullPath(file); - current.Add(rom.Size + "-" + rom.CRC, rom); - } - } - - // If we're supposed to scan the file internally - if (shouldInternalProcess) - { - // If quickscan is set, do so - if (quickScan) - { - List extracted = ArchiveTools.GetArchiveFileInfo(file, logger); - - foreach (Rom rom in extracted) - { - Rom newrom = rom; - newrom.Machine = new Machine(Path.GetFullPath(file), ""); - current.Add(rom.Size + "-" + rom.CRC, newrom); - } - } - // Otherwise, attempt to extract the files to the temporary directory - else - { - bool encounteredErrors = ArchiveTools.ExtractArchive(file, tempSubDir, archiveScanLevel, logger); - - // If the file was an archive and was extracted successfully, check it - if (!encounteredErrors) - { - logger.Verbose(Path.GetFileName(file) + " treated like an archive"); - List extracted = Directory.EnumerateFiles(tempSubDir, "*", SearchOption.AllDirectories).ToList(); - Parallel.ForEach(extracted, - new ParallelOptions { MaxDegreeOfParallelism = maxDegreeOfParallelism }, - entry => - { - Rom rom = FileTools.GetFileInfo(entry, logger, noMD5: quickScan, noSHA1: quickScan, header: headerToCheckAgainst); - rom.Machine = new Machine(Path.GetFullPath(file), ""); - current.Add(rom.Size + "-" + rom.CRC, rom); - - // If we had a header, we want the full file information too - if (headerToCheckAgainst != null) - { - rom = FileTools.GetFileInfo(file, logger, noMD5: quickScan, noSHA1: quickScan); - rom.Machine = new Machine(Path.GetFullPath(file), ""); - current.Add(rom.Size + "-" + rom.CRC, rom); - } - }); - } - // Otherwise, just get the info on the file itself - else if (File.Exists(file)) - { - Rom rom = FileTools.GetFileInfo(file, logger, noMD5: quickScan, noSHA1: quickScan, header: headerToCheckAgainst); - rom.Name = Path.GetFullPath(file); - current.Add(rom.Size + "-" + rom.CRC, rom); - } - } - } - - // Now delete the temp directory - try - { - Directory.Delete(tempSubDir, true); - } - catch { } - }); - - logger.User("Getting hash information complete in: " + DateTime.Now.Subtract(start).ToString(@"hh\:mm\:ss\.fffff")); - - #endregion - - // Create a mapping from destination file to source file - Dictionary toFromMap = new Dictionary(); - - #region Find all required files for rebuild - - logger.User("Determining files to rebuild"); - start = DateTime.Now; - - // Order the DATs by hash first to make things easier - logger.User("Sorting input DAT..."); - BucketByCRC(false, logger, output: false); - logger.User("Sorting found files..."); - current.BucketByCRC(false, logger, output: false); - - // Now loop over and find all files that need to be rebuilt - List keys = current.Keys.ToList(); - Parallel.ForEach(keys, - new ParallelOptions { MaxDegreeOfParallelism = maxDegreeOfParallelism }, - key => - { - // If we are using the DAT as a filter, treat the files one way - if (inverse) - { - // Check for duplicates - List datItems = current[key]; - foreach (Rom rom in datItems) - { - // If the rom has duplicates, we skip it - if (rom.HasDuplicates(this, logger)) - { - return; - } - - // Otherwise, map the file to itself - try - { - Rom newrom = new Rom - { - Name = rom.Name.Remove(0, Path.GetDirectoryName(rom.Name).Length), - Size = rom.Size, - CRC = rom.CRC, - MD5 = rom.MD5, - SHA1 = rom.SHA1, - - Machine = new Machine - { - Name = Path.GetFileNameWithoutExtension(rom.Machine.Name), - }, - }; - newrom.Name = newrom.Name.Remove(0, (newrom.Name.StartsWith("\\") || newrom.Name.StartsWith("/") ? 1 : 0)); - - lock (toFromMap) - { - toFromMap.Add(newrom, rom); - } - } - catch { } - } - } - - // Otherwise, treat it like a standard rebuild - else - { - // If the input DAT doesn't have the key, then nothing from the current DAT are there - if (!ContainsKey(key)) - { - return; - } - - // Otherwise, we try to find duplicates - List datItems = current[key]; - foreach (Rom rom in datItems) - { - List found = rom.GetDuplicates(this, logger, false); - - // Now add all of the duplicates mapped to the current file - foreach (Rom mid in found) - { - try - { - lock (toFromMap) - { - toFromMap.Add(mid, rom); - } - } - catch { } - } - } - } - }); - - logger.User("Determining complete in: " + DateTime.Now.Subtract(start).ToString(@"hh\:mm\:ss\.fffff")); - - #endregion - - // Now bucket the list of keys by game so that we can rebuild properly - SortedDictionary> keysGroupedByGame = BucketListByGame(toFromMap.Keys.ToList(), false, true, logger, output: false); - - #region Rebuild games in order - - switch (outputFormat) - { - case OutputFormat.Folder: - logger.User("Rebuilding all files to directory"); - break; - case OutputFormat.TapeArchive: - logger.User("Rebuilding all files to TAR"); - break; - case OutputFormat.Torrent7Zip: - logger.User("Rebuilding all files to Torrent7Z"); - break; - case OutputFormat.TorrentGzip: - logger.User("Rebuilding all files to TorrentGZ"); - break; - case OutputFormat.TorrentLrzip: - logger.User("Rebuilding all files to TorrentLRZ"); - break; - case OutputFormat.TorrentRar: - logger.User("Rebuilding all files to TorrentRAR"); - break; - case OutputFormat.TorrentXZ: - logger.User("Rebuilding all files to TorrentXZ"); - break; - case OutputFormat.TorrentZip: - logger.User("Rebuilding all files to TorrentZip"); - break; - } - start = DateTime.Now; - - // Now loop through the keys and create the correct output items - List games = keysGroupedByGame.Keys.ToList(); - Parallel.ForEach(games, - new ParallelOptions { MaxDegreeOfParallelism = maxDegreeOfParallelism }, - game => - { - // Define the temporary directory - string tempSubDir = Path.GetFullPath(Path.Combine(tempDir, Path.GetRandomFileName())) + Path.DirectorySeparatorChar; - - // Create an empty list for getting paths for rebuilding - List pathsToFiles = new List(); - - // Loop through all of the matched items in the game - List itemsInGame = keysGroupedByGame[game]; - List romsInGame = new List(); - foreach (Rom rom in itemsInGame) - { - // Get the rom that's mapped to this item - Rom source = (Rom)toFromMap[rom]; - - // If we have an empty rom or machine, there was an issue - if (source == null || source.Machine == null || source.Machine.Name == null) - { - continue; - } - - // If the file is in an archive, we need to treat it specially - string machinename = source.Machine.Name.ToLowerInvariant(); - if (machinename.EndsWith(".7z") - || machinename.EndsWith(".gz") - || machinename.EndsWith(".rar") - || machinename.EndsWith(".zip")) - { - string tempPath = ArchiveTools.ExtractItem(source.Machine.Name, Path.GetFileName(source.Name), tempSubDir, logger); - pathsToFiles.Add(tempPath); - } - - // Otherwise, we want to just add the full path - else - { - pathsToFiles.Add(source.Name); - } - - // If the size doesn't match, then we add the CRC as a postfix to the file - Rom fi = FileTools.GetFileInfo(pathsToFiles.Last(), logger); - if (fi.Size != source.Size) - { - rom.Name = Path.GetDirectoryName(rom.Name) - + (String.IsNullOrEmpty(Path.GetDirectoryName(rom.Name)) ? "" : Path.DirectorySeparatorChar.ToString()) - + Path.GetFileNameWithoutExtension(rom.Name) - + " (" + fi.CRC + ")" - + Path.GetExtension(rom.Name); - rom.CRC = fi.CRC; - rom.Size = fi.Size; - } - - // Now add the rom to the output list - romsInGame.Add(rom); - } - - // And now rebuild accordingly - switch (outputFormat) - { - case OutputFormat.Folder: - for (int i = 0; i < romsInGame.Count; i++) - { - string infile = pathsToFiles[i]; - Rom outrom = romsInGame[i]; - string outfile = Path.Combine(outDir, Style.RemovePathUnsafeCharacters(outrom.Machine.Name), outrom.Name); - - // Make sure the output folder is created - Directory.CreateDirectory(Path.GetDirectoryName(outfile)); - - // Now copy the file over - try - { - File.Copy(infile, outfile); - } - catch { } - } - break; - case OutputFormat.TapeArchive: - ArchiveTools.WriteTAR(pathsToFiles, outDir, romsInGame, logger); - break; - case OutputFormat.Torrent7Zip: - break; - case OutputFormat.TorrentGzip: - for (int i = 0; i < itemsInGame.Count; i++) - { - string infile = pathsToFiles[i]; - Rom outrom = romsInGame[i]; - outrom.Machine.Name = Style.RemovePathUnsafeCharacters(outrom.Machine.Name); - ArchiveTools.WriteTorrentGZ(infile, outDir, romba, logger); - } - break; - case OutputFormat.TorrentLrzip: - break; - case OutputFormat.TorrentRar: - break; - case OutputFormat.TorrentXZ: - break; - case OutputFormat.TorrentZip: - ArchiveTools.WriteTorrentZip(pathsToFiles, outDir, romsInGame, logger); - break; - } - - // And now clear the temp folder to get rid of any transient files - try - { - Directory.Delete(tempSubDir, true); - } - catch { } - }); - - logger.User("Rebuilding complete in: " + DateTime.Now.Subtract(start).ToString(@"hh\:mm\:ss\.fffff")); - - #endregion - - return success; - } - /// /// Process the DAT and verify the output directory /// diff --git a/SabreTools.Helper/README.1ST b/SabreTools.Helper/README.1ST index 31efafab..4c4e24d5 100644 --- a/SabreTools.Helper/README.1ST +++ b/SabreTools.Helper/README.1ST @@ -392,13 +392,6 @@ Options: (inside the running folder) is not preferred. This is used for any operations that require an archive to be extracted. - -set Enable set-creation mode (lower I/O, slower) - Optionally for slower computers, set-creation mode can be enabled. This mode parses - through all inputs and creates the logical sets first, reducing the amount of I/O - that is required to rebuild all sets by opening each output folder or archive only - once. This is much slower than the standard mode, however, because of the preprocessing - that it requires. - -d, --delete Enable deletion of the input files [DO NOT USE] Optionally, the input files, once processed, can be deleted. This can be useful when the original file structure is no longer needed or if there is limited space diff --git a/SabreTools/Partials/SabreTools.Inits.cs b/SabreTools/Partials/SabreTools.Inits.cs index 92ab3b31..49cdfbeb 100644 --- a/SabreTools/Partials/SabreTools.Inits.cs +++ b/SabreTools/Partials/SabreTools.Inits.cs @@ -301,7 +301,6 @@ namespace SabreTools /// List of input files/folders to check /// Output directory to use to build to /// Temporary directory for archive extraction - /// True if set-building mode should be enabled, false otherwise /// True to enable external scanning of archives, false otherwise /// True if the date from the DAT should be used if available, false otherwise /// True if input files should be deleted, false otherwise @@ -315,7 +314,7 @@ namespace SabreTools /// True if the updated DAT should be output, false otherwise /// Populated string representing the name of the skipper to use, a blank string to use the first available checker, null otherwise /// Integer representing the maximum amount of parallelization to be used - private static void InitSort(List datfiles, List inputs, string outDir, string tempDir, bool set, bool quickScan, bool date, bool delete, + private static void InitSort(List datfiles, List inputs, string outDir, string tempDir, bool quickScan, bool date, bool delete, bool inverse, OutputFormat outputFormat, bool romba, int sevenzip, int gz, int rar, int zip, bool updateDat, string headerToCheckAgainst, int maxDegreeOfParallelism) { @@ -333,7 +332,7 @@ namespace SabreTools } _logger.User("Populating complete in " + DateTime.Now.Subtract(start).ToString(@"hh\:mm\:ss\.fffff")); - datdata.RebuildToOutput(inputs, outDir, tempDir, set, quickScan, date, delete, inverse, outputFormat, romba, asl, + datdata.RebuildToOutput(inputs, outDir, tempDir, quickScan, date, delete, inverse, outputFormat, romba, asl, updateDat, headerToCheckAgainst, maxDegreeOfParallelism, _logger); } diff --git a/SabreTools/SabreTools.cs b/SabreTools/SabreTools.cs index cff911b3..3f0c0a7c 100644 --- a/SabreTools/SabreTools.cs +++ b/SabreTools/SabreTools.cs @@ -89,7 +89,6 @@ namespace SabreTools remext = false, removeDateFromAutomaticName = false, romba = false, - set = false, showBaddumpColumn = false, showNodumpColumn = false, shortname = false, @@ -435,10 +434,6 @@ namespace SabreTools case "--superdat": superdat = true; break; - case "-set": - case "--set": - set = true; - break; case "-sf": case "--skip": skip = true; @@ -1061,7 +1056,7 @@ namespace SabreTools // If we're using the sorter else if (sort) { - InitSort(datfiles, inputs, outDir, tempDir, set, quickScan, addFileDates, delete, inverse, + InitSort(datfiles, inputs, outDir, tempDir, quickScan, addFileDates, delete, inverse, outputFormat, romba, sevenzip, gz, rar, zip, updateDat, header, maxParallelism); }