From d1a1233e903d74dd3258ca5de13cc779eff6055f Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Wed, 15 Jun 2016 15:56:47 -0700 Subject: [PATCH] [SimpleSort] Fix normal deep scanning --- SimpleSort/SimpleSort.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/SimpleSort/SimpleSort.cs b/SimpleSort/SimpleSort.cs index ca798a56..7efedf26 100644 --- a/SimpleSort/SimpleSort.cs +++ b/SimpleSort/SimpleSort.cs @@ -446,6 +446,25 @@ namespace SabreTools } else { + // If the file isn't an archive, skip out sooner + if (ArchiveTools.GetCurrentArchiveType(input, _logger) == null) + { + // Remove the current file if we are in recursion so it's not picked up in the next step + if (recurse) + { + try + { + File.Delete(input); + } + catch (Exception ex) + { + _logger.Error(ex.ToString()); + } + } + + return success; + } + // Now, if the file is a supported archive type, also run on all files within bool encounteredErrors = !ArchiveTools.ExtractArchive(input, _tempdir, _7z, _gz, _rar, _zip, _logger);