mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[DatFile] Finally get rid of softlist; replace by desc-game
This commit is contained in:
@@ -200,7 +200,7 @@ namespace RombaSharp
|
||||
{
|
||||
// Get the DAT file associated with the key
|
||||
DatFile datFile = new DatFile();
|
||||
datFile.Parse(Path.Combine(_dats, foundDats[key]), 0, 0, _logger, softlist: true);
|
||||
datFile.Parse(Path.Combine(_dats, foundDats[key]), 0, 0, _logger);
|
||||
|
||||
// Create the new output directory if it doesn't exist
|
||||
string outputFolder = Path.Combine("out", Path.GetFileNameWithoutExtension(foundDats[key]));
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace SabreTools.Helper.Dats
|
||||
/// <param name="skip">True if the first cascaded diff file should be skipped on output, false otherwise</param>
|
||||
/// <param name="bare">True if the date should not be appended to the default name, false otherwise [OBSOLETE]</param>
|
||||
/// <param name="clean">True to clean the game names to WoD standard, false otherwise (default)</param>
|
||||
/// <param name="softlist">True to allow SL DATs to have game names used instead of descriptions, false otherwise (default)</param>
|
||||
/// <param name="descAsName">True to allow SL DATs to have game names used instead of descriptions, false otherwise (default)</param>
|
||||
/// <param name="filter">Filter object to be passed to the DatItem level</param>
|
||||
/// <param name="splitType">Type of the split that should be performed (split, merged, fully merged)</param>
|
||||
/// <param name="trim">True if we are supposed to trim names to NTFS length, false otherwise</param>
|
||||
@@ -41,7 +41,7 @@ namespace SabreTools.Helper.Dats
|
||||
/// <param name="maxDegreeOfParallelism">Integer representing the maximum amount of parallelization to be used</param>
|
||||
/// <param name="logger">Logging object for console and file output</param>
|
||||
public void DetermineUpdateType(List<string> inputPaths, string outDir, bool merge, DiffMode diff, bool inplace, bool skip,
|
||||
bool bare, bool clean, bool softlist, Filter filter, SplitType splitType, bool trim, bool single, string root,
|
||||
bool bare, bool clean, bool descAsName, Filter filter, SplitType splitType, bool trim, bool single, string root,
|
||||
int maxDegreeOfParallelism, Logger logger)
|
||||
{
|
||||
// If we're in merging or diffing mode, use the full list of inputs
|
||||
@@ -57,7 +57,7 @@ namespace SabreTools.Helper.Dats
|
||||
}
|
||||
|
||||
// Create a dictionary of all ROMs from the input DATs
|
||||
List<DatFile> datHeaders = PopulateUserData(newInputFileNames, inplace, clean, softlist,
|
||||
List<DatFile> datHeaders = PopulateUserData(newInputFileNames, inplace, clean, descAsName,
|
||||
outDir, filter, splitType, trim, single, root, maxDegreeOfParallelism, logger);
|
||||
|
||||
// Modify the Dictionary if necessary and output the results
|
||||
@@ -79,7 +79,7 @@ namespace SabreTools.Helper.Dats
|
||||
// Otherwise, loop through all of the inputs individually
|
||||
else
|
||||
{
|
||||
Update(inputPaths, outDir, clean, softlist, filter, splitType, trim, single, root, maxDegreeOfParallelism, logger);
|
||||
Update(inputPaths, outDir, clean, descAsName, filter, splitType, trim, single, root, maxDegreeOfParallelism, logger);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -95,7 +95,7 @@ namespace SabreTools.Helper.Dats
|
||||
/// <param name="maxDegreeOfParallelism">Integer representing the maximum amount of parallelization to be used</param>
|
||||
/// <param name="logger">Logging object for console and file output</param>
|
||||
/// <returns>List of DatData objects representing headers</returns>
|
||||
private List<DatFile> PopulateUserData(List<string> inputs, bool inplace, bool clean, bool softlist, string outDir,
|
||||
private List<DatFile> PopulateUserData(List<string> inputs, bool inplace, bool clean, bool descAsName, string outDir,
|
||||
Filter filter, SplitType splitType, bool trim, bool single, string root, int maxDegreeOfParallelism, Logger logger)
|
||||
{
|
||||
DatFile[] datHeaders = new DatFile[inputs.Count];
|
||||
@@ -116,7 +116,7 @@ namespace SabreTools.Helper.Dats
|
||||
MergeRoms = MergeRoms,
|
||||
};
|
||||
|
||||
datHeaders[i].Parse(input.Split('¬')[0], i, 0, filter, splitType, trim, single, root, logger, true, clean, softlist);
|
||||
datHeaders[i].Parse(input.Split('¬')[0], i, 0, filter, splitType, trim, single, root, logger, true, clean, descAsName);
|
||||
});
|
||||
|
||||
logger.User("Processing complete in " + DateTime.Now.Subtract(start).ToString(@"hh\:mm\:ss\.fffff"));
|
||||
@@ -445,7 +445,7 @@ namespace SabreTools.Helper.Dats
|
||||
/// <param name="skip">True if the first cascaded diff file should be skipped on output, false otherwise</param>
|
||||
/// <param name="bare">True if the date should not be appended to the default name, false otherwise [OBSOLETE]</param>
|
||||
/// <param name="clean">True to clean the game names to WoD standard, false otherwise (default)</param>
|
||||
/// <param name="softlist">True to allow SL DATs to have game names used instead of descriptions, false otherwise (default)</param>
|
||||
/// <param name="descAsName">True to allow SL DATs to have game names used instead of descriptions, false otherwise (default)</param>
|
||||
/// <param name="filter">Filter object to be passed to the DatItem level</param>
|
||||
/// <param name="splitType">Type of the split that should be performed (split, merged, fully merged)</param>
|
||||
/// <param name="trim">True if we are supposed to trim names to NTFS length, false otherwise</param>
|
||||
@@ -453,7 +453,7 @@ namespace SabreTools.Helper.Dats
|
||||
/// <param name="root">String representing root directory to compare against for length calculation</param>
|
||||
/// <param name="maxDegreeOfParallelism">Integer representing the maximum amount of parallelization to be used</param>
|
||||
/// <param name="logger">Logging object for console and file output</param>
|
||||
public void Update(List<string> inputFileNames, string outDir, bool clean, bool softlist, Filter filter,
|
||||
public void Update(List<string> inputFileNames, string outDir, bool clean, bool descAsName, Filter filter,
|
||||
SplitType splitType, bool trim, bool single, string root, int maxDegreeOfParallelism, Logger logger)
|
||||
{
|
||||
Parallel.ForEach(inputFileNames,
|
||||
@@ -471,7 +471,7 @@ namespace SabreTools.Helper.Dats
|
||||
DatFile innerDatdata = new DatFile(this);
|
||||
logger.User("Processing \"" + Path.GetFileName(inputFileName) + "\"");
|
||||
innerDatdata.Parse(inputFileName, 0, 0, filter, splitType, trim, single,
|
||||
root, logger, true, clean, softlist,
|
||||
root, logger, true, clean, descAsName,
|
||||
keepext: ((innerDatdata.DatFormat & DatFormat.TSV) != 0 || (innerDatdata.DatFormat & DatFormat.CSV) != 0));
|
||||
|
||||
// Try to output the file
|
||||
@@ -488,7 +488,7 @@ namespace SabreTools.Helper.Dats
|
||||
logger.User("Processing \"" + Path.GetFullPath(file).Remove(0, inputFileName.Length) + "\"");
|
||||
DatFile innerDatdata = new DatFile(this);
|
||||
innerDatdata.Parse(file, 0, 0, filter, splitType,
|
||||
trim, single, root, logger, true, clean, softlist,
|
||||
trim, single, root, logger, true, clean, descAsName,
|
||||
keepext: ((innerDatdata.DatFormat & DatFormat.TSV) != 0 || (innerDatdata.DatFormat & DatFormat.CSV) != 0));
|
||||
|
||||
// Try to output the file
|
||||
|
||||
@@ -32,14 +32,14 @@ namespace SabreTools.Helper.Dats
|
||||
/// <param name="logger">Logger object for console and/or file output</param>
|
||||
/// <param name="keep">True if full pathnames are to be kept, false otherwise (default)</param>
|
||||
/// <param name="clean">True if game names are sanitized, false otherwise (default)</param>
|
||||
/// <param name="softlist">True if SL XML names should be kept, false otherwise (default)</param>
|
||||
/// <param name="descAsName">True if descriptions should be used as names, false otherwise (default)</param>
|
||||
/// <param name="keepext">True if original extension should be kept, false otherwise (default)</param>
|
||||
/// <param name="useTags">True if tags from the DAT should be used to merge the output, false otherwise (default)</param>
|
||||
public void Parse(string filename, int sysid, int srcid, Logger logger,
|
||||
bool keep = false, bool clean = false, bool softlist = false, bool keepext = false, bool useTags = false)
|
||||
bool keep = false, bool clean = false, bool descAsName = false, bool keepext = false, bool useTags = false)
|
||||
{
|
||||
Parse(filename, sysid, srcid, new Filter(), SplitType.None, false, false, "", logger,
|
||||
keep: keep, clean: clean, softlist: softlist, keepext: keepext, useTags: useTags);
|
||||
keep: keep, clean: clean, descAsName: descAsName, keepext: keepext, useTags: useTags);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -56,7 +56,7 @@ namespace SabreTools.Helper.Dats
|
||||
/// <param name="logger">Logger object for console and/or file output</param>
|
||||
/// <param name="keep">True if full pathnames are to be kept, false otherwise (default)</param>
|
||||
/// <param name="clean">True if game names are sanitized, false otherwise (default)</param>
|
||||
/// <param name="softlist">True if SL XML names should be kept, false otherwise (default)</param>
|
||||
/// <param name="descAsName">True if descriptions should be used as names, false otherwise (default)</param>
|
||||
/// <param name="keepext">True if original extension should be kept, false otherwise (default)</param>
|
||||
/// <param name="useTags">True if tags from the DAT should be used to merge the output, false otherwise (default)</param>
|
||||
public void Parse(
|
||||
@@ -78,7 +78,7 @@ namespace SabreTools.Helper.Dats
|
||||
Logger logger,
|
||||
bool keep = false,
|
||||
bool clean = false,
|
||||
bool softlist = false,
|
||||
bool descAsName = false,
|
||||
bool keepext = false,
|
||||
bool useTags = false)
|
||||
{
|
||||
@@ -103,17 +103,17 @@ namespace SabreTools.Helper.Dats
|
||||
switch (FileTools.GetDatFormat(filename, logger))
|
||||
{
|
||||
case DatFormat.AttractMode:
|
||||
ParseAttractMode(filename, sysid, srcid, filter, trim, single, root, logger, keep, clean);
|
||||
ParseAttractMode(filename, sysid, srcid, filter, trim, single, root, logger, keep, clean, descAsName);
|
||||
break;
|
||||
case DatFormat.ClrMamePro:
|
||||
case DatFormat.DOSCenter:
|
||||
ParseCMP(filename, sysid, srcid, filter, trim, single, root, logger, keep, clean);
|
||||
ParseCMP(filename, sysid, srcid, filter, trim, single, root, logger, keep, clean, descAsName);
|
||||
break;
|
||||
case DatFormat.Logiqx:
|
||||
case DatFormat.OfflineList:
|
||||
case DatFormat.SabreDat:
|
||||
case DatFormat.SoftwareList:
|
||||
ParseGenericXML(filename, sysid, srcid, filter, trim, single, root, logger, keep, clean, softlist);
|
||||
ParseGenericXML(filename, sysid, srcid, filter, trim, single, root, logger, keep, clean, descAsName);
|
||||
break;
|
||||
case DatFormat.RedumpMD5:
|
||||
ParseRedumpMD5(filename, sysid, srcid, filter, trim, single, root, logger, clean);
|
||||
@@ -128,7 +128,7 @@ namespace SabreTools.Helper.Dats
|
||||
ParseRedumpSHA256(filename, sysid, srcid, filter, trim, single, root, logger, clean);
|
||||
break;
|
||||
case DatFormat.RomCenter:
|
||||
ParseRC(filename, sysid, srcid, filter, trim, single, root, logger, clean);
|
||||
ParseRC(filename, sysid, srcid, filter, trim, single, root, logger, clean, descAsName);
|
||||
break;
|
||||
default:
|
||||
return;
|
||||
@@ -188,6 +188,7 @@ namespace SabreTools.Helper.Dats
|
||||
/// <param name="logger">Logger object for console and/or file output</param>
|
||||
/// <param name="keep">True if full pathnames are to be kept, false otherwise (default)</param>
|
||||
/// <param name="clean">True if game names are sanitized, false otherwise (default)</param>
|
||||
/// <param name="descAsName">True if descriptions should be used as names, false otherwise (default)</param>
|
||||
private void ParseAttractMode(
|
||||
// Standard Dat parsing
|
||||
string filename,
|
||||
@@ -205,7 +206,8 @@ namespace SabreTools.Helper.Dats
|
||||
// Miscellaneous
|
||||
Logger logger,
|
||||
bool keep,
|
||||
bool clean)
|
||||
bool clean,
|
||||
bool descAsName)
|
||||
{
|
||||
// Open a file reader
|
||||
Encoding enc = Style.GetEncoding(filename);
|
||||
@@ -250,7 +252,7 @@ namespace SabreTools.Helper.Dats
|
||||
|
||||
Machine = new Machine
|
||||
{
|
||||
Name = gameinfo[0],
|
||||
Name = (descAsName ? gameinfo[1] : gameinfo[0]),
|
||||
Description = gameinfo[1],
|
||||
CloneOf = gameinfo[3],
|
||||
Year = gameinfo[4],
|
||||
@@ -280,6 +282,7 @@ namespace SabreTools.Helper.Dats
|
||||
/// <param name="logger">Logger object for console and/or file output</param>
|
||||
/// <param name="keep">True if full pathnames are to be kept, false otherwise (default)</param>
|
||||
/// <param name="clean">True if game names are sanitized, false otherwise (default)</param>
|
||||
/// <param name="descAsName">True if descriptions should be used as names, false otherwise (default)</param>
|
||||
private void ParseCMP(
|
||||
// Standard Dat parsing
|
||||
string filename,
|
||||
@@ -297,7 +300,8 @@ namespace SabreTools.Helper.Dats
|
||||
// Miscellaneous
|
||||
Logger logger,
|
||||
bool keep,
|
||||
bool clean)
|
||||
bool clean,
|
||||
bool descAsName)
|
||||
{
|
||||
// Open a file reader
|
||||
Encoding enc = Style.GetEncoding(filename);
|
||||
@@ -694,6 +698,12 @@ namespace SabreTools.Helper.Dats
|
||||
break;
|
||||
case "description":
|
||||
gamedesc = itemval;
|
||||
|
||||
// If we want to have the description as the name, do so
|
||||
if (descAsName)
|
||||
{
|
||||
tempgamename = gamedesc.Replace('/', '_').Replace("\"", "''");
|
||||
}
|
||||
break;
|
||||
case "romof":
|
||||
romof = itemval;
|
||||
@@ -861,7 +871,7 @@ namespace SabreTools.Helper.Dats
|
||||
/// <param name="logger">Logger object for console and/or file output</param>
|
||||
/// <param name="keep">True if full pathnames are to be kept, false otherwise (default)</param>
|
||||
/// <param name="clean">True if game names are sanitized, false otherwise (default)</param>
|
||||
/// <param name="softlist">True if SL XML names should be kept, false otherwise (default)</param>
|
||||
/// <param name="descAsName">True if SL XML names should be kept, false otherwise (default)</param>
|
||||
private void ParseGenericXML(
|
||||
// Standard Dat parsing
|
||||
string filename,
|
||||
@@ -880,7 +890,7 @@ namespace SabreTools.Helper.Dats
|
||||
Logger logger,
|
||||
bool keep,
|
||||
bool clean,
|
||||
bool softlist)
|
||||
bool descAsName)
|
||||
{
|
||||
// Prepare all internal variables
|
||||
XmlReader subreader, headreader, flagreader;
|
||||
@@ -1514,16 +1524,8 @@ namespace SabreTools.Helper.Dats
|
||||
case "description":
|
||||
machine.Description = subreader.ReadElementContentAsString();
|
||||
|
||||
/*
|
||||
// If we want to have the description as the name, do so
|
||||
if (decAsName)
|
||||
{
|
||||
machine.Name = machine.Description.Replace('/', '_').Replace("\"", "''");
|
||||
}
|
||||
*/
|
||||
|
||||
// If we have a softlist and we don't want preserve the name
|
||||
if (!softlist && temptype == "software")
|
||||
if (descAsName)
|
||||
{
|
||||
machine.Name = machine.Description.Replace('/', '_').Replace("\"", "''");
|
||||
}
|
||||
@@ -2269,6 +2271,7 @@ namespace SabreTools.Helper.Dats
|
||||
/// <param name="root">String representing root directory to compare against for length calculation</param>
|
||||
/// <param name="logger">Logger object for console and/or file output</param>
|
||||
/// <param name="clean">True if game names are sanitized, false otherwise (default)</param>
|
||||
/// <param name="descAsName">True if descriptions should be used as names, false otherwise (default)</param>
|
||||
private void ParseRC(
|
||||
// Standard Dat parsing
|
||||
string filename,
|
||||
@@ -2285,7 +2288,8 @@ namespace SabreTools.Helper.Dats
|
||||
|
||||
// Miscellaneous
|
||||
Logger logger,
|
||||
bool clean)
|
||||
bool clean,
|
||||
bool descAsName)
|
||||
{
|
||||
// Open a file reader
|
||||
Encoding enc = Style.GetEncoding(filename);
|
||||
@@ -2415,7 +2419,7 @@ namespace SabreTools.Helper.Dats
|
||||
|
||||
Machine = new Machine
|
||||
{
|
||||
Name = rominfo[3],
|
||||
Name = (descAsName ? rominfo[4] : rominfo[3]),
|
||||
Description = rominfo[4],
|
||||
CloneOf = rominfo[1],
|
||||
RomOf = rominfo[8],
|
||||
|
||||
@@ -159,6 +159,10 @@ Options:
|
||||
This allows the user to skip calculating the SHA-1 for each of the files which will
|
||||
speed up the creation of the DAT.
|
||||
|
||||
-ns256, --noSHA256 Don't include SHA256 in output
|
||||
This allows the user to skip calculating the SHA-256 for each of the files which will
|
||||
speed up the creation of the DAT.
|
||||
|
||||
-b, --bare Don't include date in file name
|
||||
Normally, the DAT will be created with the date in the file name. This flag removes
|
||||
that but keeps the date tag intact.
|
||||
@@ -206,9 +210,12 @@ Options:
|
||||
-osfv, --output-sfv Output in SFV format
|
||||
Add outputting the created DAT to SFV format
|
||||
|
||||
-osha1, -output-sha1 Output in SHA-1 format
|
||||
-osha1, --output-sha1 Output in SHA-1 format
|
||||
Add outputting the created DAT to SHA1 format
|
||||
|
||||
-osha256, --output-sha256 Output in SHA-256 format
|
||||
Add outputting the created DAT to SHA256 format
|
||||
|
||||
-osl, --output-sl Output in Software List format
|
||||
Add outputting the created DAT to Software List XML format
|
||||
|
||||
@@ -698,6 +705,7 @@ Options:
|
||||
- %crc% - Replaced with the CRC
|
||||
- %md5% - Replaced with the MD5
|
||||
- %sha1% - Replaced with the SHA-1
|
||||
- %sha256% - Replaced with the SHA-256
|
||||
- %size% - Replaced with the size
|
||||
|
||||
-q, --quotes Put double-quotes around each item
|
||||
@@ -729,6 +737,7 @@ Options:
|
||||
- %crc% - Replaced with the CRC
|
||||
- %md5% - Replaced with the MD5
|
||||
- %sha1% - Replaced with the SHA-1
|
||||
- %sha256% - Replaced with the SHA-256
|
||||
- %size% - Replaced with the size
|
||||
|
||||
-q, --quotes Put double-quotes around each item
|
||||
@@ -768,12 +777,18 @@ Options:
|
||||
-gp, --game-prefix Add game name as a prefix
|
||||
This allows for the name of the game to be used as a prefix to each file
|
||||
|
||||
-osha1, -output-sha1 Output in SHA-1 format
|
||||
-osha1, --output-sha1 Output in SHA-1 format
|
||||
Add outputting the created DAT to SHA1 format
|
||||
|
||||
-gp, --game-prefix Add game name as a prefix
|
||||
This allows for the name of the game to be used as a prefix to each file
|
||||
|
||||
-osha256, --output-sha256 Output in SHA-256 format
|
||||
Add outputting the created DAT to SHA256 format
|
||||
|
||||
-gp, --game-prefix Add game name as a prefix
|
||||
This allows for the name of the game to be used as a prefix to each file
|
||||
|
||||
-osl, --output-sl Output in Software List format
|
||||
Add outputting the created DAT to Software List XML format
|
||||
|
||||
@@ -792,6 +807,7 @@ Options:
|
||||
- %crc% - Replaced with the CRC
|
||||
- %md5% - Replaced with the MD5
|
||||
- %sha1% - Replaced with the SHA-1
|
||||
- %sha256% - Replaced with the SHA-256
|
||||
- %size% - Replaced with the size
|
||||
|
||||
-q, --quotes Put double-quotes around each item
|
||||
@@ -862,11 +878,12 @@ Options:
|
||||
Game names will be santitized to remove what the original WoD standards
|
||||
deemed as unneeded information, such as parenthized or bracketed strings
|
||||
|
||||
-sl, --softlist Use Software List name instead of description
|
||||
By default, software list DATs are treated as "incorrect", using the game
|
||||
descriptions as the name instead, since they tend to be more descriptive.
|
||||
Enabling this flag allows for the original name to be preserved and keeping
|
||||
the description as just a description.
|
||||
-dan, --desc-name Use Software List name instead of description
|
||||
By default, all DATs are converted exactly as they are input. Enabling this flag
|
||||
allows for the machine names in the DAT to be replaced by the machine description
|
||||
instead. In most cases, this will result in no change in the output DAT, but a
|
||||
notable example would be a software list DAT where the machine names are
|
||||
generally DOS-friendly while the description is more complete.
|
||||
|
||||
-dm, --dat-merged Create merged sets in the output DAT
|
||||
Preprocess the DAT to have parent sets contain all items from the children based
|
||||
@@ -955,6 +972,8 @@ Options:
|
||||
-nmd5=, --not-md5= Exclude by MD5 hash
|
||||
-sha1=, --sha1= Filter by SHA-1 hash
|
||||
-nsha1=, --not-sha1= Exclude by SHA-1 hash
|
||||
-sha256=, --sha256= Filter by SHA-256 hash
|
||||
-nsha256=, --not-sha256 Exclude by SHA-256 hash
|
||||
For each of the flags above, the user can specify either an exact match or can use
|
||||
full C#-style regex for pattern matching. Multiples of each of the above inputs are
|
||||
allowed.
|
||||
|
||||
@@ -966,9 +966,9 @@ namespace SabreTools
|
||||
"Clean game names according to WoD standards",
|
||||
FeatureType.Flag,
|
||||
null));
|
||||
update.AddFeature("softlist", new Feature(
|
||||
new List<string>() { "-sl", "--softlist" },
|
||||
"Use Software List name instead of description",
|
||||
update.AddFeature("desc-name", new Feature(
|
||||
new List<string>() { "-dan", "--desc-name" },
|
||||
"Use description instead of machine name",
|
||||
FeatureType.Flag,
|
||||
null));
|
||||
update.AddFeature("dat-merged", new Feature(
|
||||
|
||||
@@ -175,7 +175,7 @@ namespace SabreTools
|
||||
if (File.Exists(input))
|
||||
{
|
||||
DatFile datFile = new DatFile();
|
||||
datFile.Parse(Path.GetFullPath(input), 0, 0, _logger, softlist: true);
|
||||
datFile.Parse(Path.GetFullPath(input), 0, 0, _logger);
|
||||
datFile.SplitByExt(outDir, Path.GetDirectoryName(input), exta, extb, _logger);
|
||||
}
|
||||
else if (Directory.Exists(input))
|
||||
@@ -183,7 +183,7 @@ namespace SabreTools
|
||||
foreach (string file in Directory.EnumerateFiles(input, "*", SearchOption.AllDirectories))
|
||||
{
|
||||
DatFile datFile = new DatFile();
|
||||
datFile.Parse(Path.GetFullPath(file), 0, 0, _logger, softlist: true);
|
||||
datFile.Parse(Path.GetFullPath(file), 0, 0, _logger);
|
||||
datFile.SplitByExt(outDir, (input.EndsWith(Path.DirectorySeparatorChar.ToString()) ? input : input + Path.DirectorySeparatorChar), exta, extb, _logger);
|
||||
}
|
||||
}
|
||||
@@ -210,7 +210,7 @@ namespace SabreTools
|
||||
if (File.Exists(input))
|
||||
{
|
||||
DatFile datFile = new DatFile();
|
||||
datFile.Parse(Path.GetFullPath(input), 0, 0, _logger, softlist: true);
|
||||
datFile.Parse(Path.GetFullPath(input), 0, 0, _logger);
|
||||
datFile.SplitByHash(outDir, Path.GetDirectoryName(input), _logger);
|
||||
}
|
||||
else if (Directory.Exists(input))
|
||||
@@ -218,7 +218,7 @@ namespace SabreTools
|
||||
foreach (string file in Directory.EnumerateFiles(input, "*", SearchOption.AllDirectories))
|
||||
{
|
||||
DatFile datFile = new DatFile();
|
||||
datFile.Parse(Path.GetFullPath(file), 0, 0, _logger, softlist: true);
|
||||
datFile.Parse(Path.GetFullPath(file), 0, 0, _logger);
|
||||
datFile.SplitByHash(outDir, (input.EndsWith(Path.DirectorySeparatorChar.ToString()) ? input : input + Path.DirectorySeparatorChar), _logger);
|
||||
}
|
||||
}
|
||||
@@ -270,7 +270,7 @@ namespace SabreTools
|
||||
if (File.Exists(input))
|
||||
{
|
||||
DatFile datFile = new DatFile();
|
||||
datFile.Parse(Path.GetFullPath(input), 0, 0, _logger, softlist: true, keep: true);
|
||||
datFile.Parse(Path.GetFullPath(input), 0, 0, _logger, keep: true);
|
||||
datFile.SplitByLevel(outDir, Path.GetDirectoryName(input), shortname, basedat, _logger);
|
||||
}
|
||||
else if (Directory.Exists(input))
|
||||
@@ -278,7 +278,7 @@ namespace SabreTools
|
||||
foreach (string file in Directory.EnumerateFiles(input, "*", SearchOption.AllDirectories))
|
||||
{
|
||||
DatFile datFile = new DatFile();
|
||||
datFile.Parse(Path.GetFullPath(file), 0, 0, _logger, softlist: true, keep: true);
|
||||
datFile.Parse(Path.GetFullPath(file), 0, 0, _logger, keep: true);
|
||||
datFile.SplitByLevel(outDir, (input.EndsWith(Path.DirectorySeparatorChar.ToString()) ? input : input + Path.DirectorySeparatorChar), shortname, basedat, _logger);
|
||||
}
|
||||
}
|
||||
@@ -328,7 +328,7 @@ namespace SabreTools
|
||||
foreach (string datfile in datfiles)
|
||||
{
|
||||
datdata.Parse(datfile, 99, 99, new Filter(), splitType, false /* trim */, false /* single */, null /* root */, _logger,
|
||||
keep: true, softlist: true, useTags: true);
|
||||
keep: true, useTags: true);
|
||||
}
|
||||
_logger.User("Populating complete in " + DateTime.Now.Subtract(start).ToString(@"hh\:mm\:ss\.fffff"));
|
||||
|
||||
@@ -363,7 +363,7 @@ namespace SabreTools
|
||||
foreach (string datfile in datfiles)
|
||||
{
|
||||
datdata.Parse(datfile, 99, 99, new Filter(), splitType, false /* trim */, false /* single */, null /* root */, _logger,
|
||||
keep: true, softlist: true, useTags: true);
|
||||
keep: true, useTags: true);
|
||||
}
|
||||
_logger.User("Populating complete in " + DateTime.Now.Subtract(start).ToString(@"hh\:mm\:ss\.fffff"));
|
||||
|
||||
@@ -399,7 +399,7 @@ namespace SabreTools
|
||||
if (File.Exists(input))
|
||||
{
|
||||
DatFile datFile = new DatFile();
|
||||
datFile.Parse(Path.GetFullPath(input), 0, 0, _logger, softlist: true);
|
||||
datFile.Parse(Path.GetFullPath(input), 0, 0, _logger;
|
||||
datFile.SplitByType(outDir, Path.GetFullPath(Path.GetDirectoryName(input)), _logger);
|
||||
}
|
||||
else if (Directory.Exists(input))
|
||||
@@ -407,7 +407,7 @@ namespace SabreTools
|
||||
foreach (string file in Directory.EnumerateFiles(input, "*", SearchOption.AllDirectories))
|
||||
{
|
||||
DatFile datFile = new DatFile();
|
||||
datFile.Parse(Path.GetFullPath(file), 0, 0, _logger, softlist: true);
|
||||
datFile.Parse(Path.GetFullPath(file), 0, 0, _logger);
|
||||
datFile.SplitByType(outDir, Path.GetFullPath((input.EndsWith(Path.DirectorySeparatorChar.ToString()) ? input : input + Path.DirectorySeparatorChar)), _logger);
|
||||
}
|
||||
}
|
||||
@@ -471,7 +471,7 @@ namespace SabreTools
|
||||
/// /* Output DAT info */
|
||||
/// <param name="outDir">Optional param for output directory</param>
|
||||
/// <param name="clean">True to clean the game names to WoD standard, false otherwise (default)</param>
|
||||
/// <param name="softlist">True to allow SL DATs to have game names used instead of descriptions, false otherwise (default)</param>
|
||||
/// <param name="descAsName">True if descriptions should be used as names, false otherwise (default)</param>
|
||||
/// <param name="dedup">True to dedupe the roms in the DAT, false otherwise (default)</param>
|
||||
/// /* Multithreading info */
|
||||
/// <param name="maxDegreeOfParallelism">Integer representing the maximum amount of parallelization to be used</param>
|
||||
@@ -527,7 +527,7 @@ namespace SabreTools
|
||||
/* Output DAT info */
|
||||
string outDir,
|
||||
bool clean,
|
||||
bool softlist,
|
||||
bool descAsName,
|
||||
bool dedup,
|
||||
|
||||
/* Multithreading info */
|
||||
@@ -666,7 +666,7 @@ namespace SabreTools
|
||||
Romba = romba,
|
||||
};
|
||||
|
||||
userInputDat.DetermineUpdateType(inputs, outDir, merge, diffMode, inplace, skip, bare, clean, softlist,
|
||||
userInputDat.DetermineUpdateType(inputs, outDir, merge, diffMode, inplace, skip, bare, clean, descAsName,
|
||||
filter, splitType, trim, single, root, maxDegreeOfParallelism, _logger);
|
||||
}
|
||||
|
||||
@@ -694,7 +694,7 @@ namespace SabreTools
|
||||
foreach (string datfile in datfiles)
|
||||
{
|
||||
datdata.Parse(datfile, 99, 99, new Filter(), splitType, false /* trim */, false /* single */, null /* root */, _logger,
|
||||
keep: true, softlist: true, useTags: true);
|
||||
keep: true, useTags: true);
|
||||
}
|
||||
_logger.User("Populating complete in " + DateTime.Now.Subtract(start).ToString(@"hh\:mm\:ss\.fffff"));
|
||||
|
||||
@@ -720,7 +720,7 @@ namespace SabreTools
|
||||
foreach (string datfile in datfiles)
|
||||
{
|
||||
datdata.Parse(datfile, 99, 99, new Filter(), splitType, false /* trim */, false /* single */, null /* root */, _logger,
|
||||
keep: true, softlist: true, useTags: true);
|
||||
keep: true, useTags: true);
|
||||
}
|
||||
_logger.User("Populating complete in " + DateTime.Now.Subtract(start).ToString(@"hh\:mm\:ss\.fffff"));
|
||||
|
||||
|
||||
@@ -95,6 +95,7 @@ namespace SabreTools
|
||||
datPrefix = false,
|
||||
dedup = false,
|
||||
delete = false,
|
||||
descAsName = false,
|
||||
enableGzip = false,
|
||||
excludeOf = false,
|
||||
hashOnly = false,
|
||||
@@ -114,7 +115,6 @@ namespace SabreTools
|
||||
showNodumpColumn = false,
|
||||
shortname = false,
|
||||
single = false,
|
||||
softlist = false,
|
||||
superdat = false,
|
||||
trim = false,
|
||||
skip = false,
|
||||
@@ -307,6 +307,10 @@ namespace SabreTools
|
||||
case "--csv":
|
||||
statDatFormat |= StatDatFormat.CSV;
|
||||
break;
|
||||
case "-dan":
|
||||
case "--desc-name":
|
||||
descAsName = true;
|
||||
break;
|
||||
case "-dd":
|
||||
case "--dedup":
|
||||
dedup = true;
|
||||
@@ -511,10 +515,6 @@ namespace SabreTools
|
||||
case "--single":
|
||||
single = true;
|
||||
break;
|
||||
case "-sl":
|
||||
case "--softlist":
|
||||
softlist = true;
|
||||
break;
|
||||
case "-t7z":
|
||||
case "--t7z":
|
||||
outputFormat = OutputFormat.Torrent7Zip;
|
||||
@@ -1187,7 +1187,7 @@ namespace SabreTools
|
||||
InitUpdate(inputs, filename, name, description, rootdir, category, version, date, author, email, homepage, url, comment, header,
|
||||
superdat, forcemerge, forcend, forcepack, excludeOf, datFormat, usegame, prefix,
|
||||
postfix, quotes, repext, addext, remext, datPrefix, romba, merge, diffMode, inplace, skip, removeDateFromAutomaticName,
|
||||
filter, splitType, trim, single, root, outDir, cleanGameNames, softlist, dedup, maxParallelism);
|
||||
filter, splitType, trim, single, root, outDir, cleanGameNames, descAsName, dedup, maxParallelism);
|
||||
}
|
||||
|
||||
// If we're using the verifier
|
||||
|
||||
Reference in New Issue
Block a user