[DatFile] Re-add single-file DAT creation for DFD

This commit is contained in:
Matt Nadareski
2016-10-24 16:01:03 -07:00
parent b6aa1f4c62
commit 64733038f8
2 changed files with 69 additions and 50 deletions

View File

@@ -5188,7 +5188,9 @@ namespace SabreTools.Helper.Dats
Description = Name + (bare ? "" : " (" + Date + ")");
}
// Process the input folder
// Process the input
if (Directory.Exists(basePath))
{
logger.Verbose("Folder found: " + basePath);
// Process the files in all subfolders
@@ -5255,6 +5257,12 @@ namespace SabreTools.Helper.Dats
}
});
}
}
else if (File.Exists(basePath))
{
DFDProcessPossibleArchive(basePath, basePath, noMD5, noSHA1, bare, archivesAsFiles, enableGzip, addBlanks, addDate,
tempDir, copyFiles, headerToCheckAgainst, maxDegreeOfParallelism, logger);
}
// Now that we're done, delete the temp folder (if it's not the default)
logger.User("Cleaning temp folder");
@@ -5545,8 +5553,19 @@ namespace SabreTools.Helper.Dats
// Update rom information
datItem.Name = romname;
if (datItem.Machine == null)
{
datItem.Machine = new Machine
{
Name = gamename,
Description = gamename,
};
}
else
{
datItem.Machine.Name = gamename;
datItem.Machine.Description = gamename;
}
// Add the file information to the DAT
lock (Files)

View File

@@ -158,7 +158,7 @@ namespace SabreTools
// For each input directory, create a DAT
foreach (string path in inputs)
{
if (Directory.Exists(path))
if (Directory.Exists(path) || File.Exists(path))
{
// Clone the base Dat for information
DatFile datdata = (DatFile)basedat.Clone();