Revert part of "[DATFromDir] Try to delete the copied file in more places"

This commit is contained in:
Matt Nadareski
2016-09-22 14:21:12 -07:00
parent 42896494f5
commit 65fc83e4f5

View File

@@ -245,12 +245,6 @@ namespace SabreTools
{ {
List<Rom> extracted = FileTools.GetArchiveFileInfo(newItem, _logger); List<Rom> extracted = FileTools.GetArchiveFileInfo(newItem, _logger);
// Cue to delete the file if it's a copy
if (_copyFiles && item != newItem)
{
FileTools.DeleteDirectory(Path.GetDirectoryName(newItem));
}
foreach (Rom rom in extracted) foreach (Rom rom in extracted)
{ {
ProcessFileHelper(newItem, ProcessFileHelper(newItem,
@@ -263,12 +257,6 @@ namespace SabreTools
else if (File.Exists(newItem)) else if (File.Exists(newItem))
{ {
ProcessFile(newItem, newBasePath, ""); ProcessFile(newItem, newBasePath, "");
// Cue to delete the file if it's a copy
if (_copyFiles && item != newItem)
{
FileTools.DeleteDirectory(Path.GetDirectoryName(newItem));
}
} }
} }
// Otherwise, attempt to extract the files to the temporary directory // Otherwise, attempt to extract the files to the temporary directory
@@ -285,12 +273,6 @@ namespace SabreTools
// If the file was an archive and was extracted successfully, check it // If the file was an archive and was extracted successfully, check it
if (!encounteredErrors) if (!encounteredErrors)
{ {
// Cue to delete the file if it's a copy
if (_copyFiles && item != newItem)
{
FileTools.DeleteDirectory(Path.GetDirectoryName(newItem));
}
_logger.Log(Path.GetFileName(item) + " treated like an archive"); _logger.Log(Path.GetFileName(item) + " treated like an archive");
List<string> extracted = Directory.EnumerateFiles(tempSubDir, "*", SearchOption.AllDirectories).ToList(); List<string> extracted = Directory.EnumerateFiles(tempSubDir, "*", SearchOption.AllDirectories).ToList();
Parallel.ForEach(extracted, Parallel.ForEach(extracted,
@@ -309,13 +291,13 @@ namespace SabreTools
else if (File.Exists(newItem)) else if (File.Exists(newItem))
{ {
ProcessFile(newItem, newBasePath, ""); ProcessFile(newItem, newBasePath, "");
}
}
// Cue to delete the file if it's a copy // Cue to delete the file if it's a copy
if (_copyFiles && item != newItem) if (_copyFiles && item != newItem)
{ {
FileTools.DeleteDirectory(Path.GetDirectoryName(newItem)); FileTools.DeleteFile(newItem);
}
}
} }
// Delete the sub temp directory // Delete the sub temp directory