mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[ALL] Add documentation for SimpleSort in SabreTools; port over Verify
This commit is contained in:
@@ -312,8 +312,8 @@ namespace SabreTools
|
||||
{
|
||||
if (datfiles.Count > 0)
|
||||
{
|
||||
InitSortVerify(datfiles, inputs, outDir, tempDir, quickScan, date, toFolder,
|
||||
verify, delete, tgz, romba, sevenzip, gz, rar, zip, updateDat, header, logger);
|
||||
InitSort(datfiles, inputs, outDir, tempDir, quickScan, date, toFolder,
|
||||
delete, tgz, romba, sevenzip, gz, rar, zip, updateDat, header, logger);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -387,7 +387,7 @@ namespace SabreTools
|
||||
logger.User("Organizing complete in " + DateTime.Now.Subtract(start).ToString(@"hh\:mm\:ss\.fffff"));
|
||||
|
||||
SimpleSort ss = new SimpleSort(datdata, newinputs, outDir, tempDir, false, false,
|
||||
false, false, delete, tgz, romba, asl, false, null, logger);
|
||||
false, delete, tgz, romba, asl, false, null, logger);
|
||||
return ss.Convert();
|
||||
}
|
||||
|
||||
@@ -402,7 +402,6 @@ namespace SabreTools
|
||||
/// <param name="date">True if the date from the DAT should be used if available, false otherwise</param>
|
||||
/// <param name="sevenzip">Integer representing the archive handling level for 7z</param>
|
||||
/// <param name="toFolder">True if files should be output to folder, false otherwise</param>
|
||||
/// <param name="verify">True if output directory should be checked instead of rebuilt to, false otherwise</param>
|
||||
/// <param name="delete">True if input files should be deleted, false otherwise</param>
|
||||
/// <param name="tgz">True to output files in TorrentGZ format, false for TorrentZip</param>
|
||||
/// <param name="romba">True if files should be output in Romba depot folders, false otherwise</param>
|
||||
@@ -412,8 +411,8 @@ namespace SabreTools
|
||||
/// <param name="updateDat">True if the updated DAT should be output, false otherwise</param>
|
||||
/// <param name="headerToCheckAgainst">Populated string representing the name of the skipper to use, a blank string to use the first available checker, null otherwise</param>
|
||||
/// <param name="logger">Logger object for file and console output</param>
|
||||
private static void InitSortVerify(List<string> datfiles, List<string> inputs, string outDir, string tempDir, bool quickScan, bool date,
|
||||
bool toFolder, bool verify, bool delete, bool tgz, bool romba, int sevenzip, int gz, int rar, int zip, bool updateDat, string headerToCheckAgainst, Logger logger)
|
||||
private static void InitSort(List<string> datfiles, List<string> inputs, string outDir, string tempDir, bool quickScan, bool date,
|
||||
bool toFolder, bool delete, bool tgz, bool romba, int sevenzip, int gz, int rar, int zip, bool updateDat, string headerToCheckAgainst, Logger logger)
|
||||
{
|
||||
// Get the archive scanning level
|
||||
ArchiveScanLevel asl = ArchiveTools.GetArchiveScanLevelFromNumbers(sevenzip, gz, rar, zip);
|
||||
@@ -430,8 +429,35 @@ namespace SabreTools
|
||||
logger.User("Populating complete in " + DateTime.Now.Subtract(start).ToString(@"hh\:mm\:ss\.fffff"));
|
||||
|
||||
SimpleSort ss = new SimpleSort(datdata, inputs, outDir, tempDir, quickScan, date,
|
||||
toFolder, verify, delete, tgz, romba, asl, updateDat, headerToCheckAgainst, logger);
|
||||
ss.StartProcessing();
|
||||
toFolder, delete, tgz, romba, asl, updateDat, headerToCheckAgainst, logger);
|
||||
ss.RebuildToOutput();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Wrap verifying files using an input DAT
|
||||
/// </summary>
|
||||
/// <param name="datfiles">Names of the DATs to compare against</param>
|
||||
/// <param name="inputs">Input directories to compare against</param>
|
||||
/// <param name="tempDir">Temporary directory for archive extraction</param>
|
||||
/// <param name="headerToCheckAgainst">Populated string representing the name of the skipper to use, a blank string to use the first available checker, null otherwise</param>
|
||||
/// <param name="logger">Logger object for file and console output</param>
|
||||
private static void InitVerify(List<string> datfiles, List<string> inputs, string tempDir, string headerToCheckAgainst, Logger logger)
|
||||
{
|
||||
// Get the archive scanning level
|
||||
ArchiveScanLevel asl = ArchiveTools.GetArchiveScanLevelFromNumbers(1, 1, 1, 1);
|
||||
|
||||
DateTime start = DateTime.Now;
|
||||
logger.User("Populating internal DAT...");
|
||||
|
||||
// Add all of the input DATs into one huge internal DAT
|
||||
DatFile datdata = new DatFile();
|
||||
foreach (string datfile in datfiles)
|
||||
{
|
||||
datdata.Parse(datfile, 99, 99, logger, keep: true, softlist: true);
|
||||
}
|
||||
logger.User("Populating complete in " + DateTime.Now.Subtract(start).ToString(@"hh\:mm\:ss\.fffff"));
|
||||
|
||||
FileTools.VerifyDirectory(datdata, inputs, tempDir, headerToCheckAgainst, logger);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user