diff --git a/SabreTools/Partials/SabreTools_Inits.cs b/SabreTools/Partials/SabreTools_Inits.cs index 647d82af..fcfc683c 100644 --- a/SabreTools/Partials/SabreTools_Inits.cs +++ b/SabreTools/Partials/SabreTools_Inits.cs @@ -45,6 +45,43 @@ namespace SabreTools } } + /// + /// Wrap sorting files using an input DAT + /// + /// List of all inputted files and folders + /// Output directory (empty for default directory) + /// Temporary directory for archive extraction + /// True if input files should be deleted, false otherwise + /// True if files should be output in Romba depot folders, false otherwise + /// Integer representing the archive handling level for 7z + /// Integer representing the archive handling level for GZip + /// Integer representing the archive handling level for RAR + /// Integer representing the archive handling level for Zip + /// Logger object for file and console output + public static bool InitConvertFolderTGZ(List inputs, string outdir, string tempdir, bool delete, + bool romba, int sevenzip, int gz, int rar, int zip, Logger logger) + { + // Get all individual files from the inputs + List newinputs = new List(); + foreach (string input in inputs) + { + if (File.Exists(input)) + { + newinputs.Add(Path.GetFullPath(input)); + } + else if (Directory.Exists(input)) + { + foreach (string file in Directory.EnumerateFiles(input, "*", SearchOption.AllDirectories)) + { + newinputs.Add(Path.GetFullPath(file)); + } + } + } + + SimpleSort ss = new SimpleSort(new Dat(), newinputs, outdir, tempdir, false, false, false, delete, true, romba, sevenzip, gz, rar, zip, false, logger); + return ss.Convert(); + } + /// /// Wrap creating a DAT file from files or a directory /// @@ -404,7 +441,7 @@ namespace SabreTools /// Integer representing the archive handling level for Zip /// True if the updated DAT should be output, false otherwise /// Logger object for file and console output - private static void InitSimpleSort(List datfiles, List inputs, string outdir, string tempdir, bool quickScan, + private static void InitSortVerify(List datfiles, List inputs, string outdir, string tempdir, bool quickScan, bool toFolder, bool verify, bool delete, bool tgz, bool romba, int sevenzip, int gz, int rar, int zip, bool updateDat, Logger logger) { // Add all of the input DATs into one huge internal DAT diff --git a/SimpleSort/SimpleSortApp.cs b/SimpleSort/SimpleSortApp.cs index 98d71d60..ee515bf7 100644 --- a/SimpleSort/SimpleSortApp.cs +++ b/SimpleSort/SimpleSortApp.cs @@ -193,7 +193,7 @@ namespace SabreTools // If we are converting the folder to TGZ if (convert) { - InitConvert(inputs, outdir, tempdir, delete, romba, sevenzip, gz, rar, zip, logger); + InitConvertFolderTGZ(inputs, outdir, tempdir, delete, romba, sevenzip, gz, rar, zip, logger); } // If we are doing a simple sort @@ -270,7 +270,7 @@ namespace SabreTools /// Integer representing the archive handling level for RAR /// Integer representing the archive handling level for Zip /// Logger object for file and console output - public static bool InitConvert(List inputs, string outdir, string tempdir, bool delete, + public static bool InitConvertFolderTGZ(List inputs, string outdir, string tempdir, bool delete, bool romba, int sevenzip, int gz, int rar, int zip, Logger logger) { // Get all individual files from the inputs