From 8e687a251d8a7e712d16afb5889a50b2d1e25694 Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Tue, 18 Aug 2020 11:34:43 -0700 Subject: [PATCH] Add RVX compatible inputs --- RombaSharp/Features/Build.cs | 2 + SabreTools.Library/DatFiles/DatFile.cs | 94 ++++++++++++++----- SabreTools.Library/DatFiles/DatHeader.cs | 5 +- SabreTools.Library/DatFiles/Missfile.cs | 2 +- SabreTools.Library/FileTypes/BaseArchive.cs | 8 +- SabreTools.Library/FileTypes/Folder.cs | 8 +- SabreTools.Library/FileTypes/GZipArchive.cs | 25 +++-- SabreTools.Library/FileTypes/LRZipArchive.cs | 8 +- SabreTools.Library/FileTypes/LZ4Archive.cs | 8 +- SabreTools.Library/FileTypes/RarArchive.cs | 8 +- .../FileTypes/SevenZipArchive.cs | 8 +- SabreTools.Library/FileTypes/TapeArchive.cs | 8 +- SabreTools.Library/FileTypes/XZArchive.cs | 23 +++-- SabreTools.Library/FileTypes/ZPAQArchive.cs | 9 +- SabreTools.Library/FileTypes/ZipArchive.cs | 8 +- SabreTools.Library/FileTypes/ZstdArchive.cs | 8 +- SabreTools.Library/IO/PathExtensions.cs | 11 ++- SabreTools/Features/BaseFeature.cs | 39 +++++++- SabreTools/Features/DatFromDir.cs | 1 + SabreTools/Features/Sort.cs | 34 +++++-- SabreTools/Features/Update.cs | 1 + SabreTools/Features/Verify.cs | 17 +++- 22 files changed, 233 insertions(+), 102 deletions(-) diff --git a/RombaSharp/Features/Build.cs b/RombaSharp/Features/Build.cs index 73f1dd5f..9bf0b3ad 100644 --- a/RombaSharp/Features/Build.cs +++ b/RombaSharp/Features/Build.cs @@ -62,6 +62,8 @@ structure according to the original DAT master directory tree structure."; // Now scan all of those depots and rebuild datFile.RebuildDepot( onlineDepots, + romroot: false, + rvx: false, outDir: outputFolder, outputFormat: (copy ? OutputFormat.TorrentGzipRomba : OutputFormat.TorrentZip), updateDat: false); diff --git a/SabreTools.Library/DatFiles/DatFile.cs b/SabreTools.Library/DatFiles/DatFile.cs index 61ed0200..489a13a9 100644 --- a/SabreTools.Library/DatFiles/DatFile.cs +++ b/SabreTools.Library/DatFiles/DatFile.cs @@ -2103,7 +2103,7 @@ namespace SabreTools.Library.DatFiles }); // Now find all folders that are empty, if we are supposed to - if (!Header.Romba && addBlanks) + if (Header.Romba == null && addBlanks) { List empties = DirectoryExtensions.ListEmpty(basePath); Parallel.ForEach(empties, Globals.ParallelOptions, dir => @@ -2177,8 +2177,8 @@ namespace SabreTools.Library.DatFiles bool addDate, bool copyFiles) { - // Special case for if we are in Romba mode (all names are supposed to be SHA-1 hashes) - if (Header.Romba) + // Special case for if we are in Romba or RVX mode (all names are supposed to be SHA-1 hashes) + if (Header.Romba != null) { GZipArchive gzarc = new GZipArchive(item); BaseFile baseFile = gzarc.GetTorrentGZFileInfo(); @@ -2400,6 +2400,8 @@ namespace SabreTools.Library.DatFiles /// Process the DAT and find all matches in input files and folders assuming they're a depot /// /// List of input files/folders to check + /// True to build from 2-deep, false to default to 4-deep + /// True to only go to 2-deep, false to default to 4-deep /// Output directory to use to build to /// True if the date from the DAT should be used if available, false otherwise /// True if input files should be deleted, false otherwise @@ -2409,6 +2411,8 @@ namespace SabreTools.Library.DatFiles /// True if rebuilding was a success, false otherwise public bool RebuildDepot( List inputs, + bool romroot = false, + bool rvx = false, string outDir = null, bool date = false, bool delete = false, @@ -2517,7 +2521,7 @@ namespace SabreTools.Library.DatFiles Globals.Logger.User($"Checking hash '{hash}'"); // Get the extension path for the hash - string subpath = PathExtensions.GetRombaPath(hash); + string subpath = PathExtensions.GetRombaPath(hash, romroot); // Find the first depot that includes the hash string foundpath = null; @@ -2549,9 +2553,9 @@ namespace SabreTools.Library.DatFiles // Otherwise, we rebuild that file to all locations that we need to bool usedInternally; if (Items[hash][0].ItemType == ItemType.Disk) - usedInternally = RebuildIndividualFile(new Disk(fileinfo), foundpath, outDir, date, inverse, outputFormat, updateDat, false /* isZip */); + usedInternally = RebuildIndividualFile(new Disk(fileinfo), foundpath, outDir, rvx, date, inverse, outputFormat, updateDat, false /* isZip */); else - usedInternally = RebuildIndividualFile(new Rom(fileinfo), foundpath, outDir, date, inverse, outputFormat, updateDat, false /* isZip */); + usedInternally = RebuildIndividualFile(new Rom(fileinfo), foundpath, outDir, rvx, date, inverse, outputFormat, updateDat, false /* isZip */); // If we are supposed to delete the depot file, do so if (delete && usedInternally) @@ -2580,6 +2584,7 @@ namespace SabreTools.Library.DatFiles /// /// List of input files/folders to check /// Output directory to use to build to + /// True to only go to 2-deep, false to default to 4-deep /// 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 @@ -2591,6 +2596,7 @@ namespace SabreTools.Library.DatFiles public bool RebuildGeneric( List inputs, string outDir = null, + bool rvx = false, bool quickScan = false, bool date = false, bool delete = false, @@ -2678,7 +2684,7 @@ namespace SabreTools.Library.DatFiles if (File.Exists(input)) { Globals.Logger.User($"Checking file: {input}"); - RebuildGenericHelper(input, outDir, quickScan, date, delete, inverse, outputFormat, updateDat, asFiles); + RebuildGenericHelper(input, outDir, rvx, quickScan, date, delete, inverse, outputFormat, updateDat, asFiles); } // If the input is a directory @@ -2688,7 +2694,7 @@ namespace SabreTools.Library.DatFiles foreach (string file in Directory.EnumerateFiles(input, "*", SearchOption.AllDirectories)) { Globals.Logger.User($"Checking file: {file}"); - RebuildGenericHelper(file, outDir, quickScan, date, delete, inverse, outputFormat, updateDat, asFiles); + RebuildGenericHelper(file, outDir, rvx, quickScan, date, delete, inverse, outputFormat, updateDat, asFiles); } } } @@ -2715,6 +2721,7 @@ namespace SabreTools.Library.DatFiles /// /// Name of the file to process /// Output directory to use to build to + /// True to only go to 2-deep, false to default to 4-deep /// 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 @@ -2725,6 +2732,7 @@ namespace SabreTools.Library.DatFiles private void RebuildGenericHelper( string file, string outDir, + bool rvx, bool quickScan, bool date, bool delete, @@ -2752,7 +2760,7 @@ namespace SabreTools.Library.DatFiles else if (externalFileInfo.Type == FileType.None) externalDatItem = new Rom(externalFileInfo); - usedExternally = RebuildIndividualFile(externalDatItem, file, outDir, date, inverse, outputFormat, updateDat, null /* isZip */); + usedExternally = RebuildIndividualFile(externalDatItem, file, outDir, rvx, date, inverse, outputFormat, updateDat, null /* isZip */); // Scan the file internally @@ -2785,7 +2793,7 @@ namespace SabreTools.Library.DatFiles else if (internalFileInfo.Type == FileType.None) internalDatItem = new Rom(internalFileInfo); - usedExternally = RebuildIndividualFile(internalDatItem, file, outDir, date, inverse, outputFormat, updateDat, null /* isZip */); + usedExternally = RebuildIndividualFile(internalDatItem, file, outDir, rvx, date, inverse, outputFormat, updateDat, null /* isZip */); } // Otherwise, loop through the entries and try to match else @@ -2793,7 +2801,7 @@ namespace SabreTools.Library.DatFiles foreach (BaseFile entry in entries) { DatItem internalDatItem = DatItem.Create(entry); - usedInternally |= RebuildIndividualFile(internalDatItem, file, outDir, date, inverse, outputFormat, updateDat, !isTorrentGzip /* isZip */); + usedInternally |= RebuildIndividualFile(internalDatItem, file, outDir, rvx, date, inverse, outputFormat, updateDat, !isTorrentGzip /* isZip */); } } @@ -2808,6 +2816,7 @@ namespace SabreTools.Library.DatFiles /// Information for the current file to rebuild from /// Name of the file to process /// Output directory to use to build to + /// True to only go to 2-deep, false to default to 4-deep /// True if the date from the DAT should be used if available, 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 @@ -2818,6 +2827,7 @@ namespace SabreTools.Library.DatFiles DatItem datItem, string file, string outDir, + bool rvx, bool date, bool inverse, OutputFormat outputFormat, @@ -2859,7 +2869,7 @@ namespace SabreTools.Library.DatFiles // Get the proper output path if (outputFormat == OutputFormat.TorrentGzipRomba) - outDir = Path.Combine(outDir, PathExtensions.GetRombaPath(sha1)); + outDir = Path.Combine(outDir, PathExtensions.GetRombaPath(sha1, rvx)); else outDir = Path.Combine(outDir, sha1 + ".gz"); @@ -2886,8 +2896,8 @@ namespace SabreTools.Library.DatFiles Globals.Logger.User($"Matches found for '{Path.GetFileName(datItem.Name)}', rebuilding accordingly..."); // Get the proper output path - if (outputFormat == OutputFormat.TorrentGzipRomba) - outDir = Path.Combine(outDir, PathExtensions.GetRombaPath(sha1)); + if (outputFormat == OutputFormat.TorrentXZRomba) + outDir = Path.Combine(outDir, PathExtensions.GetRombaPath(sha1, rvx)); else outDir = Path.Combine(outDir, sha1 + ".xz"); @@ -2959,8 +2969,13 @@ namespace SabreTools.Library.DatFiles // Get the output archive, if possible Folder outputArchive = Folder.Create(outputFormat); + // Get the romba value + bool? romba = null; + if (outputFormat == OutputFormat.TorrentGzipRomba || outputFormat == OutputFormat.TorrentXZRomba) + romba = rvx; + // Now rebuild to the output file - outputArchive.Write(fileStream, outDir, (Rom)item, date: date, romba: outputFormat == OutputFormat.TorrentGzipRomba || outputFormat == OutputFormat.TorrentXZRomba); + outputArchive.Write(fileStream, outDir, (Rom)item, date: date, romba: romba); } // Close the input stream @@ -3026,9 +3041,14 @@ namespace SabreTools.Library.DatFiles // Get the output archive, if possible Folder outputArchive = Folder.Create(outputFormat); + // Get the romba value + bool? romba = null; + if (outputFormat == OutputFormat.TorrentGzipRomba || outputFormat == OutputFormat.TorrentXZRomba) + romba = rvx; + // Now rebuild to the output file - eitherSuccess |= outputArchive.Write(transformStream, outDir, (Rom)item, date: date, romba: outputFormat == OutputFormat.TorrentGzipRomba || outputFormat == OutputFormat.TorrentXZRomba); - eitherSuccess |= outputArchive.Write(fileStream, outDir, (Rom)datItem, date: date, romba: outputFormat == OutputFormat.TorrentGzipRomba || outputFormat == OutputFormat.TorrentXZRomba); + eitherSuccess |= outputArchive.Write(transformStream, outDir, (Rom)item, date: date, romba: romba); + eitherSuccess |= outputArchive.Write(fileStream, outDir, (Rom)datItem, date: date, romba: romba); // Now add the success of either rebuild rebuilt &= eitherSuccess; @@ -3051,9 +3071,10 @@ namespace SabreTools.Library.DatFiles /// Process the DAT and verify from the depots /// /// List of input directories to compare against + /// True to only go to 2-deep, false to default to 4-deep /// Optional param for output directory /// True if verification was a success, false otherwise - public bool VerifyDepot(List inputs, string outDir = null) + public bool VerifyDepot(List inputs, bool rvx = false, string outDir = null) { bool success = true; @@ -3089,7 +3110,7 @@ namespace SabreTools.Library.DatFiles Globals.Logger.User($"Checking hash '{hash}'"); // Get the extension path for the hash - string subpath = PathExtensions.GetRombaPath(hash); + string subpath = PathExtensions.GetRombaPath(hash, rvx); // Find the first depot that includes the hash string foundpath = null; @@ -3771,7 +3792,7 @@ namespace SabreTools.Library.DatFiles string post = CreatePrefixPostfix(item, false); // If we're in Romba mode, take care of that instead - if (Header.Romba) + if (Header.Romba == true) { if (item.ItemType == ItemType.Rom) { @@ -3780,7 +3801,7 @@ namespace SabreTools.Library.DatFiles // We can only write out if there's a SHA-1 if (!string.IsNullOrWhiteSpace(romItem.SHA1)) { - name = PathExtensions.GetRombaPath(romItem.SHA1).Replace('\\', '/'); + name = PathExtensions.GetRombaPath(romItem.SHA1, Header.Romba == false).Replace('\\', '/'); item.Name = $"{pre}{name}{post}"; } } @@ -3791,7 +3812,36 @@ namespace SabreTools.Library.DatFiles // We can only write out if there's a SHA-1 if (!string.IsNullOrWhiteSpace(diskItem.SHA1)) { - name = PathExtensions.GetRombaPath(diskItem.SHA1).Replace('\\', '/'); + name = PathExtensions.GetRombaPath(diskItem.SHA1, Header.Romba == false).Replace('\\', '/'); + item.Name = pre + name + post; + } + } + + return; + } + + // If we're in RVX mode, take care of that instead + if (Header.Romba == false) + { + if (item.ItemType == ItemType.Rom) + { + Rom romItem = item as Rom; + + // We can only write out if there's a SHA-1 + if (!string.IsNullOrWhiteSpace(romItem.SHA1)) + { + name = PathExtensions.GetRombaPath(romItem.SHA1, Header.Romba == false).Replace('\\', '/'); + item.Name = $"{pre}{name}{post}"; + } + } + else if (item.ItemType == ItemType.Disk) + { + Disk diskItem = item as Disk; + + // We can only write out if there's a SHA-1 + if (!string.IsNullOrWhiteSpace(diskItem.SHA1)) + { + name = PathExtensions.GetRombaPath(diskItem.SHA1, Header.Romba == false).Replace('\\', '/'); item.Name = pre + name + post; } } diff --git a/SabreTools.Library/DatFiles/DatHeader.cs b/SabreTools.Library/DatFiles/DatHeader.cs index 5175d3fd..3fbc658f 100644 --- a/SabreTools.Library/DatFiles/DatHeader.cs +++ b/SabreTools.Library/DatFiles/DatHeader.cs @@ -211,10 +211,11 @@ namespace SabreTools.Library.DatFiles public bool RemoveExtension { get; set; } /// - /// Romba output mode + /// Romba or RVX output mode /// + /// Null means neither, false means RVX, true means Romba [JsonIgnore] - public bool Romba { get; set; } + public bool? Romba { get; set; } = null; /// /// Output the machine name diff --git a/SabreTools.Library/DatFiles/Missfile.cs b/SabreTools.Library/DatFiles/Missfile.cs index 18d576c5..caf01617 100644 --- a/SabreTools.Library/DatFiles/Missfile.cs +++ b/SabreTools.Library/DatFiles/Missfile.cs @@ -136,7 +136,7 @@ namespace SabreTools.Library.DatFiles ProcessItemName(datItem, false, forceRomName: false); // Romba mode automatically uses item name - if (Header.Romba || Header.UseRomName) + if (Header.Romba != null || Header.UseRomName) { sw.Write($"{datItem.GetField(Field.Name, Header.ExcludeFields)}\n"); } diff --git a/SabreTools.Library/FileTypes/BaseArchive.cs b/SabreTools.Library/FileTypes/BaseArchive.cs index 325790be..b5a47b05 100644 --- a/SabreTools.Library/FileTypes/BaseArchive.cs +++ b/SabreTools.Library/FileTypes/BaseArchive.cs @@ -176,9 +176,9 @@ namespace SabreTools.Library.FileTypes /// Output directory to build to /// DatItem representing the new information /// True if the date from the DAT should be used if available, false otherwise (default) - /// True if files should be output in Romba depot folders, false otherwise + /// True if files should be output in Romba depot folders, false for RVX RomRoot folders, null otherwise /// True if the archive was written properly, false otherwise - public override abstract bool Write(string inputFile, string outDir, Rom rom, bool date = false, bool romba = false); + public override abstract bool Write(string inputFile, string outDir, Rom rom, bool date = false, bool? romba = null); /// /// Write an input stream to an archive @@ -187,9 +187,9 @@ namespace SabreTools.Library.FileTypes /// Output directory to build to /// DatItem representing the new information /// True if the date from the DAT should be used if available, false otherwise (default) - /// True if files should be output in Romba depot folders, false otherwise + /// True if files should be output in Romba depot folders, false for RVX RomRoot folders, null otherwise /// True if the archive was written properly, false otherwise - public override abstract bool Write(Stream inputStream, string outDir, Rom rom, bool date = false, bool romba = false); + public override abstract bool Write(Stream inputStream, string outDir, Rom rom, bool date = false, bool? romba = null); /// /// Write a set of input files to an archive (assuming the same output archive name) diff --git a/SabreTools.Library/FileTypes/Folder.cs b/SabreTools.Library/FileTypes/Folder.cs index 56eaba4b..c61575ca 100644 --- a/SabreTools.Library/FileTypes/Folder.cs +++ b/SabreTools.Library/FileTypes/Folder.cs @@ -293,10 +293,10 @@ namespace SabreTools.Library.FileTypes /// Output directory to build to /// DatItem representing the new information /// True if the date from the DAT should be used if available, false otherwise (default) - /// True if files should be output in Romba depot folders, false otherwise + /// True if files should be output in Romba depot folders, false for RVX RomRoot folders, null otherwise /// True if the write was a success, false otherwise /// This works for now, but it can be sped up by using Ionic.Zip or another zlib wrapper that allows for header values built-in. See edc's code. - public virtual bool Write(string inputFile, string outDir, Rom rom, bool date = false, bool romba = false) + public virtual bool Write(string inputFile, string outDir, Rom rom, bool date = false, bool? romba = null) { FileStream fs = FileExtensions.TryOpenRead(inputFile); return Write(fs, outDir, rom, date, romba); @@ -309,10 +309,10 @@ namespace SabreTools.Library.FileTypes /// Output directory to build to /// DatItem representing the new information /// True if the date from the DAT should be used if available, false otherwise (default) - /// True if files should be output in Romba depot folders, false otherwise + /// True if files should be output in Romba depot folders, false for RVX RomRoot folders, null otherwise /// True if the write was a success, false otherwise /// This works for now, but it can be sped up by using Ionic.Zip or another zlib wrapper that allows for header values built-in. See edc's code. - public virtual bool Write(Stream inputStream, string outDir, Rom rom, bool date = false, bool romba = false) + public virtual bool Write(Stream inputStream, string outDir, Rom rom, bool date = false, bool? romba = null) { bool success = false; diff --git a/SabreTools.Library/FileTypes/GZipArchive.cs b/SabreTools.Library/FileTypes/GZipArchive.cs index 2f237734..bc54af15 100644 --- a/SabreTools.Library/FileTypes/GZipArchive.cs +++ b/SabreTools.Library/FileTypes/GZipArchive.cs @@ -411,10 +411,10 @@ namespace SabreTools.Library.FileTypes /// Output directory to build to /// DatItem representing the new information /// True if the date from the DAT should be used if available, false otherwise (default) - /// True if files should be output in Romba depot folders, false otherwise + /// True if files should be output in Romba depot folders, false for RVX RomRoot folders, null otherwise /// True if the write was a success, false otherwise /// This works for now, but it can be sped up by using Ionic.Zip or another zlib wrapper that allows for header values built-in. See edc's code. - public override bool Write(string inputFile, string outDir, Rom rom = null, bool date = false, bool romba = false) + public override bool Write(string inputFile, string outDir, Rom rom = null, bool date = false, bool? romba = null) { // Check that the input file exists if (!File.Exists(inputFile)) @@ -436,10 +436,10 @@ namespace SabreTools.Library.FileTypes /// Output directory to build to /// DatItem representing the new information /// True if the date from the DAT should be used if available, false otherwise (default) - /// True if files should be output in Romba depot folders, false otherwise + /// True if files should be output in Romba depot folders, false for RVX RomRoot folders, null otherwise /// True if the write was a success, false otherwise /// This works for now, but it can be sped up by using Ionic.Zip or another zlib wrapper that allows for header values built-in. See edc's code. - public override bool Write(Stream inputStream, string outDir, Rom rom = null, bool date = false, bool romba = false) + public override bool Write(Stream inputStream, string outDir, Rom rom = null, bool date = false, bool? romba = null) { bool success = false; @@ -459,16 +459,23 @@ namespace SabreTools.Library.FileTypes // Get the output file name string outfile; - // If we have a romba output, add the romba path - if (romba) + // If we have a Romba output, add the depot path + if (romba == true) { - outfile = Path.Combine(outDir, PathExtensions.GetRombaPath(rom.SHA1)); // TODO: When updating to SHA-256, this needs to update to SHA256 + outfile = Path.Combine(outDir, PathExtensions.GetRombaPath(rom.SHA1, false)); // TODO: When updating to SHA-256, this needs to update to SHA256 + + // Check to see if the folder needs to be created + if (!Directory.Exists(Path.GetDirectoryName(outfile))) + Directory.CreateDirectory(Path.GetDirectoryName(outfile)); + } + // If we have an RVX output, add the RomRoot path + else if (romba == false) + { + outfile = Path.Combine(outDir, PathExtensions.GetRombaPath(rom.SHA1, true)); // TODO: When updating to SHA-256, this needs to update to SHA256 // Check to see if the folder needs to be created if (!Directory.Exists(Path.GetDirectoryName(outfile))) - { Directory.CreateDirectory(Path.GetDirectoryName(outfile)); - } } // Otherwise, we're just rebuilding to the main directory else diff --git a/SabreTools.Library/FileTypes/LRZipArchive.cs b/SabreTools.Library/FileTypes/LRZipArchive.cs index 9f29a722..0b9d6f40 100644 --- a/SabreTools.Library/FileTypes/LRZipArchive.cs +++ b/SabreTools.Library/FileTypes/LRZipArchive.cs @@ -117,10 +117,10 @@ namespace SabreTools.Library.FileTypes /// Output directory to build to /// DatItem representing the new information /// True if the date from the DAT should be used if available, false otherwise (default) - /// True if files should be output in Romba depot folders, false otherwise + /// True if files should be output in Romba depot folders, false for RVX RomRoot folders, null otherwise /// True if the write was a success, false otherwise /// This works for now, but it can be sped up by using Ionic.Zip or another zlib wrapper that allows for header values built-in. See edc's code. - public override bool Write(string inputFile, string outDir, Rom rom, bool date = false, bool romba = false) + public override bool Write(string inputFile, string outDir, Rom rom, bool date = false, bool? romba = null) { throw new NotImplementedException(); } @@ -132,10 +132,10 @@ namespace SabreTools.Library.FileTypes /// Output directory to build to /// DatItem representing the new information /// True if the date from the DAT should be used if available, false otherwise (default) - /// True if files should be output in Romba depot folders, false otherwise + /// True if files should be output in Romba depot folders, false for RVX RomRoot folders, null otherwise /// True if the write was a success, false otherwise /// This works for now, but it can be sped up by using Ionic.Zip or another zlib wrapper that allows for header values built-in. See edc's code. - public override bool Write(Stream inputStream, string outDir, Rom rom, bool date = false, bool romba = false) + public override bool Write(Stream inputStream, string outDir, Rom rom, bool date = false, bool? romba = null) { throw new NotImplementedException(); } diff --git a/SabreTools.Library/FileTypes/LZ4Archive.cs b/SabreTools.Library/FileTypes/LZ4Archive.cs index 9f1d5717..d10bfe38 100644 --- a/SabreTools.Library/FileTypes/LZ4Archive.cs +++ b/SabreTools.Library/FileTypes/LZ4Archive.cs @@ -117,10 +117,10 @@ namespace SabreTools.Library.FileTypes /// Output directory to build to /// DatItem representing the new information /// True if the date from the DAT should be used if available, false otherwise (default) - /// True if files should be output in Romba depot folders, false otherwise + /// True if files should be output in Romba depot folders, false for RVX RomRoot folders, null otherwise /// True if the write was a success, false otherwise /// This works for now, but it can be sped up by using Ionic.Zip or another zlib wrapper that allows for header values built-in. See edc's code. - public override bool Write(string inputFile, string outDir, Rom rom, bool date = false, bool romba = false) + public override bool Write(string inputFile, string outDir, Rom rom, bool date = false, bool? romba = null) { throw new NotImplementedException(); } @@ -132,10 +132,10 @@ namespace SabreTools.Library.FileTypes /// Output directory to build to /// DatItem representing the new information /// True if the date from the DAT should be used if available, false otherwise (default) - /// True if files should be output in Romba depot folders, false otherwise + /// True if files should be output in Romba depot folders, false for RVX RomRoot folders, null otherwise /// True if the write was a success, false otherwise /// This works for now, but it can be sped up by using Ionic.Zip or another zlib wrapper that allows for header values built-in. See edc's code. - public override bool Write(Stream inputStream, string outDir, Rom rom, bool date = false, bool romba = false) + public override bool Write(Stream inputStream, string outDir, Rom rom, bool date = false, bool? romba = null) { throw new NotImplementedException(); } diff --git a/SabreTools.Library/FileTypes/RarArchive.cs b/SabreTools.Library/FileTypes/RarArchive.cs index c5c4386f..c2a3567c 100644 --- a/SabreTools.Library/FileTypes/RarArchive.cs +++ b/SabreTools.Library/FileTypes/RarArchive.cs @@ -284,9 +284,9 @@ namespace SabreTools.Library.FileTypes /// Output directory to build to /// DatItem representing the new information /// True if the date from the DAT should be used if available, false otherwise (default) - /// True if files should be output in Romba depot folders, false otherwise + /// True if files should be output in Romba depot folders, false for RVX RomRoot folders, null otherwise /// True if the archive was written properly, false otherwise - public override bool Write(string inputFile, string outDir, Rom rom, bool date = false, bool romba = false) + public override bool Write(string inputFile, string outDir, Rom rom, bool date = false, bool? romba = null) { // Get the file stream for the file and write out return Write(FileExtensions.TryOpenRead(inputFile), outDir, rom, date, romba); @@ -299,9 +299,9 @@ namespace SabreTools.Library.FileTypes /// Output directory to build to /// DatItem representing the new information /// True if the date from the DAT should be used if available, false otherwise (default) - /// True if files should be output in Romba depot folders, false otherwise + /// True if files should be output in Romba depot folders, false for RVX RomRoot folders, null otherwise /// True if the archive was written properly, false otherwise - public override bool Write(Stream inputStream, string outDir, Rom rom, bool date = false, bool romba = false) + public override bool Write(Stream inputStream, string outDir, Rom rom, bool date = false, bool? romba = null) { throw new NotImplementedException(); } diff --git a/SabreTools.Library/FileTypes/SevenZipArchive.cs b/SabreTools.Library/FileTypes/SevenZipArchive.cs index 1dbf3d80..35db0084 100644 --- a/SabreTools.Library/FileTypes/SevenZipArchive.cs +++ b/SabreTools.Library/FileTypes/SevenZipArchive.cs @@ -414,9 +414,9 @@ namespace SabreTools.Library.FileTypes /// Output directory to build to /// DatItem representing the new information /// True if the date from the DAT should be used if available, false otherwise (default) - /// True if files should be output in Romba depot folders, false otherwise + /// True if files should be output in Romba depot folders, false for RVX RomRoot folders, null otherwise /// True if the archive was written properly, false otherwise - public override bool Write(string inputFile, string outDir, Rom rom, bool date = false, bool romba = false) + public override bool Write(string inputFile, string outDir, Rom rom, bool date = false, bool? romba = null) { // Get the file stream for the file and write out return Write(FileExtensions.TryOpenRead(inputFile), outDir, rom, date: date); @@ -429,9 +429,9 @@ namespace SabreTools.Library.FileTypes /// Output directory to build to /// DatItem representing the new information /// True if the date from the DAT should be used if available, false otherwise (default) - /// True if files should be output in Romba depot folders, false otherwise + /// True if files should be output in Romba depot folders, false for RVX RomRoot folders, null otherwise /// True if the archive was written properly, false otherwise - public override bool Write(Stream inputStream, string outDir, Rom rom, bool date = false, bool romba = false) + public override bool Write(Stream inputStream, string outDir, Rom rom, bool date = false, bool? romba = null) { bool success = false; string tempFile = Path.Combine(outDir, $"tmp{Guid.NewGuid()}"); diff --git a/SabreTools.Library/FileTypes/TapeArchive.cs b/SabreTools.Library/FileTypes/TapeArchive.cs index 30c28fab..4bc827df 100644 --- a/SabreTools.Library/FileTypes/TapeArchive.cs +++ b/SabreTools.Library/FileTypes/TapeArchive.cs @@ -289,9 +289,9 @@ namespace SabreTools.Library.FileTypes /// Output directory to build to /// DatItem representing the new information /// True if the date from the DAT should be used if available, false otherwise (default) - /// True if files should be output in Romba depot folders, false otherwise + /// True if files should be output in Romba depot folders, false for RVX RomRoot folders, null otherwise /// True if the archive was written properly, false otherwise - public override bool Write(string inputFile, string outDir, Rom rom, bool date = false, bool romba = false) + public override bool Write(string inputFile, string outDir, Rom rom, bool date = false, bool? romba = null) { // Get the file stream for the file and write out return Write(FileExtensions.TryOpenRead(inputFile), outDir, rom, date: date); @@ -304,9 +304,9 @@ namespace SabreTools.Library.FileTypes /// Output directory to build to /// DatItem representing the new information /// True if the date from the DAT should be used if available, false otherwise (default) - /// True if files should be output in Romba depot folders, false otherwise + /// True if files should be output in Romba depot folders, false for RVX RomRoot folders, null otherwise /// True if the archive was written properly, false otherwise - public override bool Write(Stream inputStream, string outDir, Rom rom, bool date = false, bool romba = false) + public override bool Write(Stream inputStream, string outDir, Rom rom, bool date = false, bool? romba = null) { bool success = false; string tempFile = Path.Combine(outDir, $"tmp{Guid.NewGuid()}"); diff --git a/SabreTools.Library/FileTypes/XZArchive.cs b/SabreTools.Library/FileTypes/XZArchive.cs index 68285e99..2778363d 100644 --- a/SabreTools.Library/FileTypes/XZArchive.cs +++ b/SabreTools.Library/FileTypes/XZArchive.cs @@ -312,10 +312,10 @@ namespace SabreTools.Library.FileTypes /// Output directory to build to /// DatItem representing the new information /// True if the date from the DAT should be used if available, false otherwise (default) - /// True if files should be output in Romba depot folders, false otherwise + /// True if files should be output in Romba depot folders, false for RVX RomRoot folders, null otherwise /// True if the write was a success, false otherwise /// This works for now, but it can be sped up by using Ionic.Zip or another zlib wrapper that allows for header values built-in. See edc's code. - public override bool Write(string inputFile, string outDir, Rom rom, bool date = false, bool romba = false) + public override bool Write(string inputFile, string outDir, Rom rom, bool date = false, bool? romba = null) { // Check that the input file exists if (!File.Exists(inputFile)) @@ -337,9 +337,9 @@ namespace SabreTools.Library.FileTypes /// Output directory to build to /// DatItem representing the new information /// True if the date from the DAT should be used if available, false otherwise (default) - /// True if files should be output in Romba depot folders, false otherwise + /// True if files should be output in Romba depot folders, false for RVX RomRoot folders, null otherwise /// True if the archive was written properly, false otherwise - public override bool Write(Stream inputStream, string outDir, Rom rom, bool date = false, bool romba = false) + public override bool Write(Stream inputStream, string outDir, Rom rom, bool date = false, bool? romba = null) { bool success = false; @@ -359,10 +359,19 @@ namespace SabreTools.Library.FileTypes // Get the output file name string outfile; - // If we have a romba output, add the romba path - if (romba) + // If we have a Romba output, add the depot path + if (romba == true) { - outfile = Path.Combine(outDir, PathExtensions.GetRombaPath(rom.SHA1)); // TODO: When updating to SHA-256, this needs to update to SHA256 + outfile = Path.Combine(outDir, PathExtensions.GetRombaPath(rom.SHA1, false)); // TODO: When updating to SHA-256, this needs to update to SHA256 + + // Check to see if the folder needs to be created + if (!Directory.Exists(Path.GetDirectoryName(outfile))) + Directory.CreateDirectory(Path.GetDirectoryName(outfile)); + } + // If we have an RVX output, add the RomRoot path + else if (romba == false) + { + outfile = Path.Combine(outDir, PathExtensions.GetRombaPath(rom.SHA1, true)); // TODO: When updating to SHA-256, this needs to update to SHA256 // Check to see if the folder needs to be created if (!Directory.Exists(Path.GetDirectoryName(outfile))) diff --git a/SabreTools.Library/FileTypes/ZPAQArchive.cs b/SabreTools.Library/FileTypes/ZPAQArchive.cs index 2c761f3e..d790b9cb 100644 --- a/SabreTools.Library/FileTypes/ZPAQArchive.cs +++ b/SabreTools.Library/FileTypes/ZPAQArchive.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; using System.IO; -using SabreTools.Library.Data; using SabreTools.Library.DatFiles; using SabreTools.Library.DatItems; @@ -117,10 +116,10 @@ namespace SabreTools.Library.FileTypes /// Output directory to build to /// DatItem representing the new information /// True if the date from the DAT should be used if available, false otherwise (default) - /// True if files should be output in Romba depot folders, false otherwise + /// True if files should be output in Romba depot folders, false for RVX RomRoot folders, null otherwise /// True if the write was a success, false otherwise /// This works for now, but it can be sped up by using Ionic.Zip or another zlib wrapper that allows for header values built-in. See edc's code. - public override bool Write(string inputFile, string outDir, Rom rom, bool date = false, bool romba = false) + public override bool Write(string inputFile, string outDir, Rom rom, bool date = false, bool? romba = null) { throw new NotImplementedException(); } @@ -132,10 +131,10 @@ namespace SabreTools.Library.FileTypes /// Output directory to build to /// DatItem representing the new information /// True if the date from the DAT should be used if available, false otherwise (default) - /// True if files should be output in Romba depot folders, false otherwise + /// True if files should be output in Romba depot folders, false for RVX RomRoot folders, null otherwise /// True if the write was a success, false otherwise /// This works for now, but it can be sped up by using Ionic.Zip or another zlib wrapper that allows for header values built-in. See edc's code. - public override bool Write(Stream inputStream, string outDir, Rom rom, bool date = false, bool romba = false) + public override bool Write(Stream inputStream, string outDir, Rom rom, bool date = false, bool? romba = null) { throw new NotImplementedException(); } diff --git a/SabreTools.Library/FileTypes/ZipArchive.cs b/SabreTools.Library/FileTypes/ZipArchive.cs index 61d3f311..db16d71c 100644 --- a/SabreTools.Library/FileTypes/ZipArchive.cs +++ b/SabreTools.Library/FileTypes/ZipArchive.cs @@ -419,9 +419,9 @@ namespace SabreTools.Library.FileTypes /// Output directory to build to /// DatItem representing the new information /// True if the date from the DAT should be used if available, false otherwise (default) - /// True if files should be output in Romba depot folders, false otherwise + /// True if files should be output in Romba depot folders, false for RVX RomRoot folders, null otherwise /// True if the archive was written properly, false otherwise - public override bool Write(string inputFile, string outDir, Rom rom, bool date = false, bool romba = false) + public override bool Write(string inputFile, string outDir, Rom rom, bool date = false, bool? romba = null) { // Get the file stream for the file and write out return Write(FileExtensions.TryOpenRead(inputFile), outDir, rom, date: date); @@ -434,9 +434,9 @@ namespace SabreTools.Library.FileTypes /// Output directory to build to /// DatItem representing the new information /// True if the date from the DAT should be used if available, false otherwise (default) - /// True if files should be output in Romba depot folders, false otherwise + /// True if files should be output in Romba depot folders, false for RVX RomRoot folders, null otherwise /// True if the archive was written properly, false otherwise - public override bool Write(Stream inputStream, string outDir, Rom rom, bool date = false, bool romba = false) + public override bool Write(Stream inputStream, string outDir, Rom rom, bool date = false, bool? romba = null) { bool success = false; string tempFile = Path.Combine(outDir, $"tmp{Guid.NewGuid()}"); diff --git a/SabreTools.Library/FileTypes/ZstdArchive.cs b/SabreTools.Library/FileTypes/ZstdArchive.cs index c6b4506a..03f0ed35 100644 --- a/SabreTools.Library/FileTypes/ZstdArchive.cs +++ b/SabreTools.Library/FileTypes/ZstdArchive.cs @@ -117,10 +117,10 @@ namespace SabreTools.Library.FileTypes /// Output directory to build to /// DatItem representing the new information /// True if the date from the DAT should be used if available, false otherwise (default) - /// True if files should be output in Romba depot folders, false otherwise + /// True if files should be output in Romba depot folders, false for RVX RomRoot folders, null otherwise /// True if the write was a success, false otherwise /// This works for now, but it can be sped up by using Ionic.Zip or another zlib wrapper that allows for header values built-in. See edc's code. - public override bool Write(string inputFile, string outDir, Rom rom, bool date = false, bool romba = false) + public override bool Write(string inputFile, string outDir, Rom rom, bool date = false, bool? romba = null) { throw new NotImplementedException(); } @@ -132,10 +132,10 @@ namespace SabreTools.Library.FileTypes /// Output directory to build to /// DatItem representing the new information /// True if the date from the DAT should be used if available, false otherwise (default) - /// True if files should be output in Romba depot folders, false otherwise + /// True if files should be output in Romba depot folders, false for RVX RomRoot folders, null otherwise /// True if the write was a success, false otherwise /// This works for now, but it can be sped up by using Ionic.Zip or another zlib wrapper that allows for header values built-in. See edc's code. - public override bool Write(Stream inputStream, string outDir, Rom rom, bool date = false, bool romba = false) + public override bool Write(Stream inputStream, string outDir, Rom rom, bool date = false, bool? romba = null) { throw new NotImplementedException(); } diff --git a/SabreTools.Library/IO/PathExtensions.cs b/SabreTools.Library/IO/PathExtensions.cs index 8d31a26c..ed2c8d72 100644 --- a/SabreTools.Library/IO/PathExtensions.cs +++ b/SabreTools.Library/IO/PathExtensions.cs @@ -37,14 +37,21 @@ namespace SabreTools.Library.IO /// Get a proper romba sub path /// /// SHA-1 hash to get the path for + /// True to only go to 2-deep, false to default to 4-deep /// Subfolder path for the given hash - public static string GetRombaPath(string hash) + public static string GetRombaPath(string hash, bool rvx) { // If the hash isn't the right size, then we return null if (hash.Length != Constants.SHA1Length) // TODO: When updating to SHA-256, this needs to update to Constants.SHA256Length return null; - return Path.Combine(hash.Substring(0, 2), hash.Substring(2, 2), hash.Substring(4, 2), hash.Substring(6, 2), hash + ".gz"); + // RVX uses a 2-deep RomRoot + if (rvx) + return Path.Combine(hash.Substring(0, 2), hash.Substring(2, 2), hash + ".gz"); + + // Romba uses a 4-deep Depot + else + return Path.Combine(hash.Substring(0, 2), hash.Substring(2, 2), hash.Substring(4, 2), hash.Substring(6, 2), hash + ".gz"); } /// diff --git a/SabreTools/Features/BaseFeature.cs b/SabreTools/Features/BaseFeature.cs index 275b6d91..8fce91f9 100644 --- a/SabreTools/Features/BaseFeature.cs +++ b/SabreTools/Features/BaseFeature.cs @@ -312,9 +312,9 @@ namespace SabreTools.Features return new Feature( DepotValue, new List() { "-dep", "--depot" }, - "Assume directories are romba depots", + "Assume directories are Romba depots", FeatureType.Flag, - longDescription: "Normally, input directories will be treated with no special format. If this flag is used, all input directories will be assumed to be romba-style depots."); + longDescription: "Normally, input directories will be treated with no special format. If this flag is used, all input directories will be assumed to be Romba-style depots."); } } @@ -794,6 +794,20 @@ namespace SabreTools.Features } } + internal const string RomRootValue = "romroot"; + internal static Feature RomRootFlag + { + get + { + return new Feature( + RomRootValue, + new List() { "-rr", "--romroot" }, + "Assume directories are RVX RomRoots", + FeatureType.Flag, + longDescription: "Normally, input directories will be treated with no special format. If this flag is used, all input directories will be assumed to be RVX-style RomRoots."); + } + } + internal const string RomsValue = "roms"; internal static Feature RomsFlag { @@ -822,6 +836,20 @@ namespace SabreTools.Features } } + internal const string RVXValue = "rvx"; + internal static Feature RVXFlag + { + get + { + return new Feature( + RVXValue, + new List() { "-rvx", "--romvaultx" }, + "Treat like an RVX RomRoot (requires SHA-1)", + FeatureType.Flag, + longDescription: "This flag allows reading and writing of DATs and output files to and from a RVX-style RomRoot. This also implies TorrentGZ input and output for physical files."); + } + } + internal const string SceneDateStripValue = "scene-date-strip"; internal static Feature SceneDateStripFlag { @@ -2633,7 +2661,6 @@ Some special strings that can be used: RegionList = GetList(features, RegionListValue), RemoveExtension = GetBoolean(features, RemoveExtensionsValue), ReplaceExtension = GetString(features, ReplaceExtensionStringValue), - Romba = GetBoolean(features, RombaValue), RootDir = GetString(features, RootStringValue), SceneDateStrip = GetBoolean(features, SceneDateStripValue), Type = GetBoolean(features, SuperdatValue) ? "SuperDAT" : null, @@ -2642,6 +2669,12 @@ Some special strings that can be used: Version = GetString(features, VersionStringValue), }; + // Romba overrides RVX for flags + if (GetBoolean(features, RombaValue)) + datHeader.Romba = true; + else if (GetBoolean(features, RVXValue)) + datHeader.Romba = false; + bool deprecated = GetBoolean(features, DeprecatedValue); foreach (string ot in GetList(features, OutputTypeListValue)) { diff --git a/SabreTools/Features/DatFromDir.cs b/SabreTools/Features/DatFromDir.cs index 30bd97ec..69857f55 100644 --- a/SabreTools/Features/DatFromDir.cs +++ b/SabreTools/Features/DatFromDir.cs @@ -35,6 +35,7 @@ namespace SabreTools.Features AddFeature(OutputTypeListInput); this[OutputTypeListInput].AddFeature(DeprecatedFlag); AddFeature(RombaFlag); + AddFeature(RVXFlag); AddFeature(SkipArchivesFlag); AddFeature(SkipFilesFlag); AddHeaderFeatures(); diff --git a/SabreTools/Features/Sort.cs b/SabreTools/Features/Sort.cs index fe094916..157a8ec0 100644 --- a/SabreTools/Features/Sort.cs +++ b/SabreTools/Features/Sort.cs @@ -25,6 +25,7 @@ namespace SabreTools.Features AddFeature(DatListInput); AddFeature(OutputDirStringInput); AddFeature(DepotFlag); + AddFeature(RomRootFlag); AddFeature(DeleteFlag); AddFeature(InverseFlag); AddFeature(QuickFlag); @@ -37,6 +38,7 @@ namespace SabreTools.Features AddFeature(TarFlag); AddFeature(TorrentGzipFlag); this[TorrentGzipFlag].AddFeature(RombaFlag); + this[TorrentGzipFlag].AddFeature(RVXFlag); //AddFeature(SharedInputs.TorrentLrzipFlag); //AddFeature(SharedInputs.TorrentLz4Flag); //AddFeature(SharedInputs.TorrentRarFlag); @@ -60,19 +62,31 @@ namespace SabreTools.Features TreatAsFiles asFiles = GetTreatAsFiles(features); bool date = GetBoolean(features, AddDateValue); bool delete = GetBoolean(features, DeleteValue); - bool depot = GetBoolean(features, DepotValue); bool inverse = GetBoolean(features, InverseValue); bool quickScan = GetBoolean(features, QuickValue); - bool romba = GetBoolean(features, RombaValue); bool updateDat = GetBoolean(features, UpdateDatValue); var outputFormat = GetOutputFormat(features); + // Romba overrides RVX for flags + bool? romba = null; + if (GetBoolean(features, RombaValue)) + romba = true; + else if (GetBoolean(features, RVXValue)) + romba = false; + + // Depot overrides RomRoot for flags + bool? depot = null; + if (GetBoolean(features, DepotValue)) + depot = true; + else if (GetBoolean(features, RomRootValue)) + depot = false; + // If we have TorrentGzip output and the romba flag, update - if (romba && outputFormat == OutputFormat.TorrentGzip) + if (romba != null && outputFormat == OutputFormat.TorrentGzip) outputFormat = OutputFormat.TorrentGzipRomba; // If we hae TorrentXZ output and the romba flag, update - if (romba && outputFormat == OutputFormat.TorrentXZ) + if (romba != null && outputFormat == OutputFormat.TorrentXZ) outputFormat = OutputFormat.TorrentXZRomba; // Get a list of files from the input datfiles @@ -92,10 +106,10 @@ namespace SabreTools.Features datdata.Header.HeaderSkipper = Header.HeaderSkipper; // If we have the depot flag, respect it - if (depot) - datdata.RebuildDepot(Inputs, Path.Combine(OutputDir, datdata.Header.FileName), date, delete, inverse, outputFormat, updateDat); + if (depot != null) + datdata.RebuildDepot(Inputs, depot == false, romba == false, Path.Combine(OutputDir, datdata.Header.FileName), date, delete, inverse, outputFormat, updateDat); else - datdata.RebuildGeneric(Inputs, Path.Combine(OutputDir, datdata.Header.FileName), quickScan, date, delete, inverse, outputFormat, updateDat, asFiles); + datdata.RebuildGeneric(Inputs, Path.Combine(OutputDir, datdata.Header.FileName), romba == false, quickScan, date, delete, inverse, outputFormat, updateDat, asFiles); } } @@ -118,10 +132,10 @@ namespace SabreTools.Features watch.Stop(); // If we have the depot flag, respect it - if (depot) - datdata.RebuildDepot(Inputs, OutputDir, date, delete, inverse, outputFormat, updateDat); + if (depot != null) + datdata.RebuildDepot(Inputs, depot == false, romba == false, OutputDir, date, delete, inverse, outputFormat, updateDat); else - datdata.RebuildGeneric(Inputs, OutputDir, quickScan, date, delete, inverse, outputFormat, updateDat, asFiles); + datdata.RebuildGeneric(Inputs, OutputDir, romba == false, quickScan, date, delete, inverse, outputFormat, updateDat, asFiles); } } } diff --git a/SabreTools/Features/Update.cs b/SabreTools/Features/Update.cs index 38edd7d6..adbcc347 100644 --- a/SabreTools/Features/Update.cs +++ b/SabreTools/Features/Update.cs @@ -32,6 +32,7 @@ namespace SabreTools.Features this[OutputTypeListInput].AddFeature(ReplaceExtensionStringInput); this[OutputTypeListInput].AddFeature(RemoveExtensionsFlag); this[OutputTypeListInput].AddFeature(RombaFlag); + this[OutputTypeListInput].AddFeature(RVXFlag); this[OutputTypeListInput].AddFeature(DeprecatedFlag); AddHeaderFeatures(); diff --git a/SabreTools/Features/Verify.cs b/SabreTools/Features/Verify.cs index 8c5b6691..3c853b7b 100644 --- a/SabreTools/Features/Verify.cs +++ b/SabreTools/Features/Verify.cs @@ -22,6 +22,7 @@ namespace SabreTools.Features AddFeature(DatListInput); AddFeature(DepotFlag); + AddFeature(RomRootFlag); AddFeature(TempStringInput); AddFeature(OutputDirStringInput); AddFeature(HashOnlyFlag); @@ -43,10 +44,16 @@ namespace SabreTools.Features // Get feature flags TreatAsFiles asFiles = GetTreatAsFiles(features); - bool depot = GetBoolean(features, DepotValue); bool hashOnly = GetBoolean(features, HashOnlyValue); bool quickScan = GetBoolean(features, QuickValue); + // Depot overrides RomRoot for flags + bool? depot = null; + if (GetBoolean(features, DepotValue)) + depot = true; + else if (GetBoolean(features, RomRootValue)) + depot = false; + // If we are in individual mode, process each DAT on their own if (GetBoolean(features, IndividualValue)) { @@ -61,8 +68,8 @@ namespace SabreTools.Features datdata.Header.HeaderSkipper = Header.HeaderSkipper; // If we have the depot flag, respect it - if (depot) - datdata.VerifyDepot(Inputs, OutputDir); + if (depot != null) + datdata.VerifyDepot(Inputs, depot == false, OutputDir); else datdata.VerifyGeneric(Inputs, OutputDir, hashOnly, quickScan, asFiles, Filter); } @@ -87,8 +94,8 @@ namespace SabreTools.Features watch.Stop(); // If we have the depot flag, respect it - if (depot) - datdata.VerifyDepot(Inputs, OutputDir); + if (depot != null) + datdata.VerifyDepot(Inputs, depot == false, OutputDir); else datdata.VerifyGeneric(Inputs, OutputDir, hashOnly, quickScan, asFiles, Filter); }