mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
[SabreTools, DatFile] Propigate variables through the update path, still not hooked up
This commit is contained in:
@@ -34,13 +34,15 @@ namespace SabreTools.Helper.Dats
|
|||||||
/// <param name="clean">True to clean the game names to WoD standard, false otherwise (default)</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="softlist">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="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>
|
/// <param name="trim">True if we are supposed to trim names to NTFS length, false otherwise</param>
|
||||||
/// <param name="single">True if all games should be replaced by '!', false otherwise</param>
|
/// <param name="single">True if all games should be replaced by '!', false otherwise</param>
|
||||||
/// <param name="root">String representing root directory to compare against for length calculation</param>
|
/// <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="maxDegreeOfParallelism">Integer representing the maximum amount of parallelization to be used</param>
|
||||||
/// <param name="logger">Logging object for console and file output</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,
|
public void DetermineUpdateType(List<string> inputPaths, string outDir, bool merge, DiffMode diff, bool inplace, bool skip,
|
||||||
bool bare, bool clean, bool softlist, Filter filter, bool trim, bool single, string root, int maxDegreeOfParallelism, Logger logger)
|
bool bare, bool clean, bool softlist, 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
|
// If we're in merging or diffing mode, use the full list of inputs
|
||||||
if (merge || diff != 0)
|
if (merge || diff != 0)
|
||||||
@@ -56,7 +58,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
|
|
||||||
// Create a dictionary of all ROMs from the input 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, softlist,
|
||||||
outDir, filter, trim, single, root, maxDegreeOfParallelism, logger);
|
outDir, filter, splitType, trim, single, root, maxDegreeOfParallelism, logger);
|
||||||
|
|
||||||
// Modify the Dictionary if necessary and output the results
|
// Modify the Dictionary if necessary and output the results
|
||||||
if (diff != 0 && diff < DiffMode.Cascade)
|
if (diff != 0 && diff < DiffMode.Cascade)
|
||||||
@@ -77,7 +79,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
// Otherwise, loop through all of the inputs individually
|
// Otherwise, loop through all of the inputs individually
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Update(inputPaths, outDir, clean, softlist, filter, trim, single, root, maxDegreeOfParallelism, logger);
|
Update(inputPaths, outDir, clean, softlist, filter, splitType, trim, single, root, maxDegreeOfParallelism, logger);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -85,6 +87,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Populate the user DatData object from the input files
|
/// Populate the user DatData object from the input files
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
/// <param name="splitType">Type of the split that should be performed (split, merged, fully merged)</param>
|
||||||
/// <param name="filter">Filter object to be passed to the DatItem level</param>
|
/// <param name="filter">Filter object to be passed to the DatItem level</param>
|
||||||
/// <param name="trim">True if we are supposed to trim names to NTFS length, false otherwise</param>
|
/// <param name="trim">True if we are supposed to trim names to NTFS length, false otherwise</param>
|
||||||
/// <param name="single">True if all games should be replaced by '!', false otherwise</param>
|
/// <param name="single">True if all games should be replaced by '!', false otherwise</param>
|
||||||
@@ -93,7 +96,7 @@ namespace SabreTools.Helper.Dats
|
|||||||
/// <param name="logger">Logging object for console and file output</param>
|
/// <param name="logger">Logging object for console and file output</param>
|
||||||
/// <returns>List of DatData objects representing headers</returns>
|
/// <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 softlist, string outDir,
|
||||||
Filter filter, bool trim, bool single, string root, int maxDegreeOfParallelism, Logger logger)
|
Filter filter, SplitType splitType, bool trim, bool single, string root, int maxDegreeOfParallelism, Logger logger)
|
||||||
{
|
{
|
||||||
DatFile[] datHeaders = new DatFile[inputs.Count];
|
DatFile[] datHeaders = new DatFile[inputs.Count];
|
||||||
DateTime start = DateTime.Now;
|
DateTime start = DateTime.Now;
|
||||||
@@ -439,13 +442,14 @@ namespace SabreTools.Helper.Dats
|
|||||||
/// <param name="clean">True to clean the game names to WoD standard, false otherwise (default)</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="softlist">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="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>
|
/// <param name="trim">True if we are supposed to trim names to NTFS length, false otherwise</param>
|
||||||
/// <param name="single">True if all games should be replaced by '!', false otherwise</param>
|
/// <param name="single">True if all games should be replaced by '!', false otherwise</param>
|
||||||
/// <param name="root">String representing root directory to compare against for length calculation</param>
|
/// <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="maxDegreeOfParallelism">Integer representing the maximum amount of parallelization to be used</param>
|
||||||
/// <param name="logger">Logging object for console and file output</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 softlist, Filter filter,
|
||||||
bool trim, bool single, string root, int maxDegreeOfParallelism, Logger logger)
|
SplitType splitType, bool trim, bool single, string root, int maxDegreeOfParallelism, Logger logger)
|
||||||
{
|
{
|
||||||
Parallel.ForEach(inputFileNames,
|
Parallel.ForEach(inputFileNames,
|
||||||
new ParallelOptions { MaxDegreeOfParallelism = maxDegreeOfParallelism },
|
new ParallelOptions { MaxDegreeOfParallelism = maxDegreeOfParallelism },
|
||||||
|
|||||||
@@ -448,6 +448,7 @@ namespace SabreTools
|
|||||||
/// <param name="notgametype">Select games without the given type</param>
|
/// <param name="notgametype">Select games without the given type</param>
|
||||||
/// <param name="runnable">Select games with the given runability</param>
|
/// <param name="runnable">Select games with the given runability</param>
|
||||||
/// /* Trimming info */
|
/// /* Trimming info */
|
||||||
|
/// <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>
|
/// <param name="trim">True if we are supposed to trim names to NTFS length, false otherwise</param>
|
||||||
/// <param name="single">True if all games should be replaced by '!', false otherwise</param>
|
/// <param name="single">True if all games should be replaced by '!', false otherwise</param>
|
||||||
/// <param name="root">String representing root directory to compare against for length calculation</param>
|
/// <param name="root">String representing root directory to compare against for length calculation</param>
|
||||||
@@ -521,6 +522,7 @@ namespace SabreTools
|
|||||||
bool? runnable,
|
bool? runnable,
|
||||||
|
|
||||||
/* Trimming info */
|
/* Trimming info */
|
||||||
|
SplitType splitType,
|
||||||
bool trim,
|
bool trim,
|
||||||
bool single,
|
bool single,
|
||||||
string root,
|
string root,
|
||||||
@@ -654,6 +656,7 @@ namespace SabreTools
|
|||||||
case "bios":
|
case "bios":
|
||||||
machineNotType = MachineType.Bios;
|
machineNotType = MachineType.Bios;
|
||||||
break;
|
break;
|
||||||
|
case "dev":
|
||||||
case "device":
|
case "device":
|
||||||
machineNotType = MachineType.Device;
|
machineNotType = MachineType.Device;
|
||||||
break;
|
break;
|
||||||
@@ -737,7 +740,7 @@ namespace SabreTools
|
|||||||
notgamename, notromname, notromtype, notcrc, notmd5, notsha1, itemNotStatus, machineNotType, runnable);
|
notgamename, notromname, notromtype, notcrc, notmd5, notsha1, itemNotStatus, machineNotType, runnable);
|
||||||
|
|
||||||
userInputDat.DetermineUpdateType(inputs, outDir, merge, diffMode, inplace, skip, bare, clean, softlist,
|
userInputDat.DetermineUpdateType(inputs, outDir, merge, diffMode, inplace, skip, bare, clean, softlist,
|
||||||
filter, trim, single, root, maxDegreeOfParallelism, _logger);
|
filter, splitType, trim, single, root, maxDegreeOfParallelism, _logger);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -1080,7 +1080,7 @@ namespace SabreTools
|
|||||||
postfix, quotes, repext, addext, remext, datPrefix, romba, merge, diffMode, inplace, skip, removeDateFromAutomaticName,
|
postfix, quotes, repext, addext, remext, datPrefix, romba, merge, diffMode, inplace, skip, removeDateFromAutomaticName,
|
||||||
gamename, romname, romtype, sgt, slt, seq, crc, md5, sha1, status, gametype,
|
gamename, romname, romtype, sgt, slt, seq, crc, md5, sha1, status, gametype,
|
||||||
notgamename, notromname, notromtype, notcrc, notmd5, notsha1, notstatus, notgametype, runnable,
|
notgamename, notromname, notromtype, notcrc, notmd5, notsha1, notstatus, notgametype, runnable,
|
||||||
trim, single, root, outDir, cleanGameNames, softlist, dedup, maxParallelism);
|
splitType, trim, single, root, outDir, cleanGameNames, softlist, dedup, maxParallelism);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we're using the verifier
|
// If we're using the verifier
|
||||||
|
|||||||
Reference in New Issue
Block a user