mirror of
https://github.com/claunia/SabreTools.git
synced 2025-12-16 19:14:27 +00:00
Add defaults for DFD
This commit is contained in:
@@ -65,9 +65,8 @@ have a current entry in the DAT index.";
|
|||||||
DatFile df = DatFile.Create();
|
DatFile df = DatFile.Create();
|
||||||
foreach (string dir in onlyDirs)
|
foreach (string dir in onlyDirs)
|
||||||
{
|
{
|
||||||
// TODO: All instances of Hash.DeepHashes should be made into 0x0 eventually
|
df.PopulateFromDir(dir, asFiles: TreatAsFiles.CHDs);
|
||||||
df.PopulateFromDir(dir, Hash.DeepHashes, false, TreatAsFiles.CHDs, SkipFileType.None, false, false, false, null);
|
df.PopulateFromDir(dir, asFiles: TreatAsFiles.Archives | TreatAsFiles.CHDs);
|
||||||
df.PopulateFromDir(dir, Hash.DeepHashes, false, TreatAsFiles.Archives | TreatAsFiles.CHDs, SkipFileType.None, false, false, false, null);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create an empty Dat for files that need to be rebuilt
|
// Create an empty Dat for files that need to be rebuilt
|
||||||
|
|||||||
@@ -47,15 +47,11 @@ namespace RombaSharp.Features
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create the encapsulating datfile
|
// Create and write the encapsulating datfile
|
||||||
DatFile datfile = DatFile.Create();
|
DatFile datfile = DatFile.Create();
|
||||||
datfile.Header.Name = string.IsNullOrWhiteSpace(name) ? "untitled" : name;
|
datfile.Header.Name = string.IsNullOrWhiteSpace(name) ? "untitled" : name;
|
||||||
datfile.Header.Description = description;
|
datfile.Header.Description = description;
|
||||||
|
datfile.PopulateFromDir(source, bare: true, asFiles: TreatAsFiles.CHDs);
|
||||||
// Now run the D2D on the input and write out
|
|
||||||
// TODO: All instances of Hash.DeepHashes should be made into 0x0 eventually
|
|
||||||
datfile.PopulateFromDir(source, Hash.DeepHashes, true /* bare */, TreatAsFiles.CHDs, SkipFileType.None, false /* addBlanks */,
|
|
||||||
false /* addDate */, false /* copyFiles */, null /* filter */);
|
|
||||||
datfile.Write(outDir: outdat);
|
datfile.Write(outDir: outdat);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,9 +62,7 @@ contents of any changed dats.";
|
|||||||
// First get a list of SHA-1's from the input DATs
|
// First get a list of SHA-1's from the input DATs
|
||||||
DatFile datroot = DatFile.Create();
|
DatFile datroot = DatFile.Create();
|
||||||
datroot.Header.Type = "SuperDAT";
|
datroot.Header.Type = "SuperDAT";
|
||||||
|
datroot.PopulateFromDir(_dats, asFiles: TreatAsFiles.CHDs);
|
||||||
// TODO: All instances of Hash.DeepHashes should be made into 0x0 eventually
|
|
||||||
datroot.PopulateFromDir(_dats, Hash.DeepHashes, false, TreatAsFiles.CHDs, SkipFileType.None, false, false, false, null);
|
|
||||||
datroot.Items.BucketBy(BucketedBy.SHA1, DedupeType.None);
|
datroot.Items.BucketBy(BucketedBy.SHA1, DedupeType.None);
|
||||||
|
|
||||||
// Create a List of dat hashes in the database (SHA-1)
|
// Create a List of dat hashes in the database (SHA-1)
|
||||||
|
|||||||
@@ -64,9 +64,7 @@ namespace RombaSharp.Features
|
|||||||
|
|
||||||
// Now rescan the depot itself
|
// Now rescan the depot itself
|
||||||
DatFile depot = DatFile.Create();
|
DatFile depot = DatFile.Create();
|
||||||
|
depot.PopulateFromDir(depotname, asFiles: TreatAsFiles.CHDs);
|
||||||
// TODO: All instances of Hash.DeepHashes should be made into 0x0 eventually
|
|
||||||
depot.PopulateFromDir(depotname, Hash.DeepHashes, false, TreatAsFiles.CHDs, SkipFileType.None, false, false, false, null);
|
|
||||||
depot.Items.BucketBy(BucketedBy.SHA1, DedupeType.None);
|
depot.Items.BucketBy(BucketedBy.SHA1, DedupeType.None);
|
||||||
|
|
||||||
// Set the base queries to use
|
// Set the base queries to use
|
||||||
|
|||||||
@@ -1495,16 +1495,17 @@ namespace SabreTools.Library.DatFiles
|
|||||||
/// <param name="copyFiles">True if files should be copied to the temp directory before hashing, false otherwise</param>
|
/// <param name="copyFiles">True if files should be copied to the temp directory before hashing, false otherwise</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="useTags">True if DatFile tags override splitting, false otherwise</param>
|
/// <param name="useTags">True if DatFile tags override splitting, false otherwise</param>
|
||||||
|
/// TODO: All instances of Hash.DeepHashes should be made into 0x0 eventually
|
||||||
public bool PopulateFromDir(
|
public bool PopulateFromDir(
|
||||||
string basePath,
|
string basePath,
|
||||||
Hash omitFromScan,
|
Hash omitFromScan = Hash.DeepHashes,
|
||||||
bool bare,
|
bool bare = false,
|
||||||
TreatAsFiles asFiles,
|
TreatAsFiles asFiles = 0x00,
|
||||||
SkipFileType skipFileType,
|
SkipFileType skipFileType = SkipFileType.None,
|
||||||
bool addBlanks,
|
bool addBlanks = false,
|
||||||
bool addDate,
|
bool addDate = false,
|
||||||
bool copyFiles,
|
bool copyFiles = false,
|
||||||
Filter filter,
|
Filter filter = null,
|
||||||
bool useTags = false)
|
bool useTags = false)
|
||||||
{
|
{
|
||||||
// If the description is defined but not the name, set the name from the description
|
// If the description is defined but not the name, set the name from the description
|
||||||
@@ -2591,8 +2592,12 @@ namespace SabreTools.Library.DatFiles
|
|||||||
foreach (string input in inputs)
|
foreach (string input in inputs)
|
||||||
{
|
{
|
||||||
// TODO: All instances of Hash.DeepHashes should be made into 0x0 eventually
|
// TODO: All instances of Hash.DeepHashes should be made into 0x0 eventually
|
||||||
PopulateFromDir(input, (quickScan ? Hash.SecureHashes : Hash.DeepHashes) /* omitFromScan */, true /* bare */, asFiles,
|
PopulateFromDir(
|
||||||
SkipFileType.None, false /* addBlanks */, false /* addDate */, false /* copyFiles */, filter);
|
input,
|
||||||
|
quickScan ? Hash.SecureHashes : Hash.DeepHashes,
|
||||||
|
bare: true,
|
||||||
|
asFiles: asFiles,
|
||||||
|
filter: filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Setup the fixdat
|
// Setup the fixdat
|
||||||
|
|||||||
Reference in New Issue
Block a user